Table MySkills
This commit is contained in:
@@ -23,7 +23,13 @@ const LevelSchema = new Schema({
|
||||
years_of_exp: {
|
||||
type: Number,
|
||||
},
|
||||
}, {_id: false});
|
||||
color: {
|
||||
type: String,
|
||||
},
|
||||
theme: {
|
||||
type: String,
|
||||
},
|
||||
});
|
||||
|
||||
LevelSchema.pre('save', async function (next) {
|
||||
if (this.isNew) {
|
||||
@@ -33,7 +39,6 @@ LevelSchema.pre('save', async function (next) {
|
||||
this._id = 1;
|
||||
else
|
||||
this._id = myrec._doc._id + 1;
|
||||
|
||||
} else {
|
||||
this._id = 1;
|
||||
}
|
||||
@@ -47,7 +52,7 @@ LevelSchema.statics.findAllIdApp = function(idapp) {
|
||||
const Level = this;
|
||||
|
||||
const query = [
|
||||
{$sort: {descr: 1}},
|
||||
{$sort: {_id: 1}},
|
||||
];
|
||||
|
||||
return Level.aggregate(query).then((arrrec) => {
|
||||
@@ -58,7 +63,6 @@ LevelSchema.statics.findAllIdApp = function(idapp) {
|
||||
|
||||
LevelSchema.statics.getFieldsForSearch = function() {
|
||||
return [
|
||||
{field: 'label', type: tools.FieldType.string},
|
||||
{field: 'descr', type: tools.FieldType.string}];
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user