@bluedot-innovation/models 6.1.2-alpha.1 → 6.1.2-alpha.2
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/Zone.js +13 -1
- package/package.json +1 -1
package/models/Zone.js
CHANGED
|
@@ -121,7 +121,19 @@ let zoneSchema = new Schema({
|
|
|
121
121
|
state: {type: String, default: StateEnum.ACTIVE, select: false},
|
|
122
122
|
accountId: {type: String, required: true, validate: {isAsync: false, validator: helpers.validateUUIDv4, msg: 'default error message'}},
|
|
123
123
|
eta: zoneEtaSchema
|
|
124
|
-
}, {collection: 'zone'})
|
|
124
|
+
}, {collection: 'zone', autoIndex: false})
|
|
125
|
+
|
|
126
|
+
zoneSchema.index(
|
|
127
|
+
{
|
|
128
|
+
projectId: 1,
|
|
129
|
+
'eta.destinationId': 1
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
unique: true,
|
|
133
|
+
partialFilterExpression: { 'eta.destinationId': { $exists:true, $type:"string" } },
|
|
134
|
+
name: "destinationUniqueWithinProject"
|
|
135
|
+
})
|
|
136
|
+
|
|
125
137
|
|
|
126
138
|
// Mongoose-json-patch
|
|
127
139
|
// https://www.npmjs.com/package/mongoose-json-patch
|
package/package.json
CHANGED