aggiornamento Indici
This commit is contained in:
@@ -122,6 +122,8 @@ const productSchema = new Schema({
|
||||
|
||||
var Product = module.exports = mongoose.model('Product', productSchema);
|
||||
|
||||
productSchema.index({ idapp: 1 });
|
||||
|
||||
module.exports.getFieldsForSearch = function () {
|
||||
return [{ field: 'name', type: tools.FieldType.string }]
|
||||
};
|
||||
@@ -211,6 +213,9 @@ module.exports.getProductByID = function (id, callback) {
|
||||
Product.findById(id, callback);
|
||||
}
|
||||
|
||||
module.exports.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
|
||||
// const Product = mongoose.model('Product', ProductSchema);
|
||||
|
||||
Reference in New Issue
Block a user