flykup_model_development 3.1.19 → 3.1.20

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.
@@ -294,6 +294,21 @@ const SellerSchema = new mongoose.Schema(
294
294
  },
295
295
  { timestamps: true, strict: true }
296
296
  );
297
+ // Add text index for seller fields
298
+ SellerSchema.index({
299
+ companyName: "text",
300
+ email: "text",
301
+ mobileNumber: "text",
302
+ productCategories: "text"
303
+ }, {
304
+ weights: {
305
+ companyName: 4,
306
+ email: 2,
307
+ mobileNumber: 1,
308
+ productCategories: 1
309
+ },
310
+ name: "seller_text_index"
311
+ });
297
312
 
298
313
  const Seller = mongoose.models.sellers || mongoose.model("sellers", SellerSchema);
299
314
  export default Seller;
@@ -167,6 +167,18 @@ UserSchema.methods.createJwtToken = function () {
167
167
  { expiresIn: "4d" }
168
168
  );
169
169
  };
170
+ UserSchema.index({
171
+ userName: "text",
172
+ name: "text",
173
+ emailId: "text"
174
+ }, {
175
+ weights: {
176
+ userName: 3,
177
+ name: 3,
178
+ emailId: 2
179
+ },
180
+ name: "user_text_index"
181
+ });
170
182
 
171
183
  UserSchema.methods.comparePassword = async function (loginPassword) {
172
184
  if (!this.password) return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flykup_model_development",
3
- "version": "3.1.19",
3
+ "version": "3.1.20",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "private": false,