flykup_model_production 1.0.9 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/models/seller.model.js +15 -1
- package/models/user.model.js +13 -0
- package/package.json +1 -1
package/models/seller.model.js
CHANGED
|
@@ -293,6 +293,20 @@ const SellerSchema = new mongoose.Schema(
|
|
|
293
293
|
},
|
|
294
294
|
{ timestamps: true, strict: true }
|
|
295
295
|
);
|
|
296
|
-
|
|
296
|
+
// Add text index for seller fields
|
|
297
|
+
SellerSchema.index({
|
|
298
|
+
companyName: "text",
|
|
299
|
+
email: "text",
|
|
300
|
+
mobileNumber: "text",
|
|
301
|
+
productCategories: "text"
|
|
302
|
+
}, {
|
|
303
|
+
weights: {
|
|
304
|
+
companyName: 4,
|
|
305
|
+
email: 2,
|
|
306
|
+
mobileNumber: 1,
|
|
307
|
+
productCategories: 1
|
|
308
|
+
},
|
|
309
|
+
name: "seller_text_index"
|
|
310
|
+
});
|
|
297
311
|
const Seller = mongoose.models.sellers || mongoose.model("sellers", SellerSchema);
|
|
298
312
|
export default Seller;
|
package/models/user.model.js
CHANGED
|
@@ -168,6 +168,19 @@ UserSchema.methods.createJwtToken = function () {
|
|
|
168
168
|
{ expiresIn: "4d" }
|
|
169
169
|
);
|
|
170
170
|
};
|
|
171
|
+
UserSchema.index({
|
|
172
|
+
userName: "text",
|
|
173
|
+
name: "text",
|
|
174
|
+
emailId: "text"
|
|
175
|
+
}, {
|
|
176
|
+
weights: {
|
|
177
|
+
userName: 3,
|
|
178
|
+
name: 3,
|
|
179
|
+
emailId: 2
|
|
180
|
+
},
|
|
181
|
+
name: "user_text_index"
|
|
182
|
+
});
|
|
183
|
+
|
|
171
184
|
|
|
172
185
|
UserSchema.methods.comparePassword = async function (loginPassword) {
|
|
173
186
|
if (!this.password) return false;
|