@akemona-org/strapi-connector-mongoose 3.12.2 → 3.12.4
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/lib/index.js +1 -1
- package/lib/mount-models.js +6 -4
- package/package.json +4 -4
package/lib/index.js
CHANGED
|
@@ -102,7 +102,7 @@ module.exports = function (strapi) {
|
|
|
102
102
|
});
|
|
103
103
|
|
|
104
104
|
const connectionString = uri || connectionURL.toString();
|
|
105
|
-
instance.set('strictQuery',
|
|
105
|
+
instance.set('strictQuery', false);
|
|
106
106
|
await instance.connect(connectionString, connectOptions);
|
|
107
107
|
} catch (error) {
|
|
108
108
|
const err = new Error(`Error connecting to the Mongo database. ${error.message}`);
|
package/lib/mount-models.js
CHANGED
|
@@ -318,7 +318,9 @@ module.exports = async ({ models, target }, ctx) => {
|
|
|
318
318
|
|
|
319
319
|
// Only sync indexes when not in production env while it's not possible to create complex indexes directly from models
|
|
320
320
|
// In production it will simply create missing indexes (those defined in the models but not present in db)
|
|
321
|
-
if
|
|
321
|
+
// * NOTE removed as compound indexes are not supported & this would remove such index if added directly on dev env
|
|
322
|
+
// * TODO can be enabled later if compound index support is added in models by chaging mount models
|
|
323
|
+
/* if (strapi.app.env !== 'production') {
|
|
322
324
|
// Ensure indexes are synced with the model, prevent duplicate index errors
|
|
323
325
|
// Side-effect: Delete all the indexes not present in the model.json
|
|
324
326
|
Model.syncIndexes().then(
|
|
@@ -329,9 +331,9 @@ module.exports = async ({ models, target }, ctx) => {
|
|
|
329
331
|
strapi.log.error('Mongo index sync failed: %o', error);
|
|
330
332
|
}
|
|
331
333
|
);
|
|
332
|
-
} else {
|
|
333
|
-
|
|
334
|
-
}
|
|
334
|
+
} else { */
|
|
335
|
+
handleIndexesErrors();
|
|
336
|
+
// }
|
|
335
337
|
|
|
336
338
|
// Expose ORM functions through the `target` object.
|
|
337
339
|
target[model] = _.assign(Model, target[model]);
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "3.12.
|
|
6
|
+
"version": "3.12.4",
|
|
7
7
|
"description": "Mongoose hook for the Strapi framework",
|
|
8
8
|
"homepage": "https://strapi.akemona.com",
|
|
9
9
|
"keywords": [
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
},
|
|
19
19
|
"main": "./lib",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@akemona-org/strapi-utils": "3.12.
|
|
21
|
+
"@akemona-org/strapi-utils": "3.12.4",
|
|
22
22
|
"lodash": "4.17.21",
|
|
23
|
-
"mongoose": "7.0.
|
|
23
|
+
"mongoose": "7.0.3",
|
|
24
24
|
"mongoose-float": "1.0.4",
|
|
25
25
|
"mongoose-long": "0.6.0",
|
|
26
26
|
"p-map": "4.0.0",
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"scripts": {
|
|
55
55
|
"test": "echo \"no tests yet\""
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "edf7db826c8babebcfa519e136874ba729667f8b"
|
|
58
58
|
}
|