@pintahub/database-schemas 5.4.1 → 5.5.0
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/package.json +1 -1
- package/schemas/Product.js +8 -9
package/package.json
CHANGED
package/schemas/Product.js
CHANGED
|
@@ -41,7 +41,6 @@ const Product = new Schema({
|
|
|
41
41
|
/** @ref Store */
|
|
42
42
|
store: {
|
|
43
43
|
type: Schema.Types.ObjectId,
|
|
44
|
-
index: true,
|
|
45
44
|
required: true,
|
|
46
45
|
},
|
|
47
46
|
|
|
@@ -86,7 +85,6 @@ const Product = new Schema({
|
|
|
86
85
|
product_type: {
|
|
87
86
|
type: String,
|
|
88
87
|
trim: true,
|
|
89
|
-
index: true,
|
|
90
88
|
},
|
|
91
89
|
|
|
92
90
|
/** Product category */
|
|
@@ -99,7 +97,6 @@ const Product = new Schema({
|
|
|
99
97
|
status: {
|
|
100
98
|
type: String,
|
|
101
99
|
default: 'draft',
|
|
102
|
-
index: true
|
|
103
100
|
},
|
|
104
101
|
|
|
105
102
|
/** Featured image */
|
|
@@ -129,7 +126,6 @@ const Product = new Schema({
|
|
|
129
126
|
tags: {
|
|
130
127
|
type: [String],
|
|
131
128
|
trim: true,
|
|
132
|
-
index: true,
|
|
133
129
|
},
|
|
134
130
|
|
|
135
131
|
/** @ref Collection — collections this product belongs to */
|
|
@@ -164,7 +160,6 @@ const Product = new Schema({
|
|
|
164
160
|
is_sale_off: {
|
|
165
161
|
type: Boolean,
|
|
166
162
|
default: false,
|
|
167
|
-
index: true,
|
|
168
163
|
},
|
|
169
164
|
|
|
170
165
|
/** Product vendor */
|
|
@@ -214,7 +209,6 @@ const Product = new Schema({
|
|
|
214
209
|
is_uploaded: {
|
|
215
210
|
type: Boolean,
|
|
216
211
|
default: false,
|
|
217
|
-
index: true,
|
|
218
212
|
},
|
|
219
213
|
|
|
220
214
|
/** Trello card ID for project tracking */
|
|
@@ -253,7 +247,6 @@ const Product = new Schema({
|
|
|
253
247
|
sales_count: {
|
|
254
248
|
type: Number,
|
|
255
249
|
default: 0,
|
|
256
|
-
index: true,
|
|
257
250
|
},
|
|
258
251
|
|
|
259
252
|
/** Number of times favorited */
|
|
@@ -278,7 +271,6 @@ const Product = new Schema({
|
|
|
278
271
|
available_for_sale: {
|
|
279
272
|
type: Boolean,
|
|
280
273
|
default: true,
|
|
281
|
-
index: true,
|
|
282
274
|
},
|
|
283
275
|
|
|
284
276
|
/** Version identifier */
|
|
@@ -309,7 +301,6 @@ const Product = new Schema({
|
|
|
309
301
|
customizable: {
|
|
310
302
|
type: Boolean,
|
|
311
303
|
default: false,
|
|
312
|
-
index: true,
|
|
313
304
|
},
|
|
314
305
|
|
|
315
306
|
/** Page template name */
|
|
@@ -384,6 +375,14 @@ const Product = new Schema({
|
|
|
384
375
|
}
|
|
385
376
|
})
|
|
386
377
|
|
|
378
|
+
Product.index({store: 1, status: 1, is_primary: 1, sales_count: -1})
|
|
379
|
+
|
|
380
|
+
Product.index({store: 1, product_type: 1, status: 1})
|
|
381
|
+
|
|
382
|
+
Product.index({
|
|
383
|
+
store: 1, status: 1, publications: 1, collections: 1, views_count: -1
|
|
384
|
+
})
|
|
385
|
+
|
|
387
386
|
/** Full-text search index */
|
|
388
387
|
Product.index({
|
|
389
388
|
title: 'text',
|