aggiornamento Indici

This commit is contained in:
Surya Paolo
2023-12-09 11:55:58 +01:00
parent 502ed32c42
commit 023ba26003
81 changed files with 293 additions and 21 deletions

View File

@@ -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);