@akemona-org/strapi-connector-mongoose 3.10.4 → 3.12.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/README.md +1 -15
- package/lib/mount-models.js +8 -1
- package/lib/utils/index.js +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -8,21 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
This built-in connector allows you to use the [Mongoose ORM](http://mongoosejs.com/).
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
## Deprecation Warning :warning:
|
|
14
|
-
|
|
15
|
-
Hello, we've some news to share!
|
|
16
|
-
|
|
17
|
-
We released Strapi V4 in Q4 2021 and Strapi V3 will reach end-of-support around the end of Q3 2022.
|
|
18
|
-
|
|
19
|
-
Since this package won't be ported in V4, we took the decision to deprecate it.
|
|
20
|
-
|
|
21
|
-
If you’ve contributed to the development of this package, thank you again for that! We hope to see you on the V4 soon.
|
|
22
|
-
|
|
23
|
-
The Akemona team
|
|
24
|
-
|
|
25
|
-
---
|
|
11
|
+
### Maintenance release by Akemona
|
|
26
12
|
|
|
27
13
|
[Mongoose ORM](http://mongoosejs.com/) provides a straight-forward, schema-based solution to model your application data. It includes built-in type casting, validation, query building, business logic connectors and more, out of the box.
|
|
28
14
|
|
package/lib/mount-models.js
CHANGED
|
@@ -321,7 +321,14 @@ module.exports = async ({ models, target }, ctx) => {
|
|
|
321
321
|
if (strapi.app.env !== 'production') {
|
|
322
322
|
// Ensure indexes are synced with the model, prevent duplicate index errors
|
|
323
323
|
// Side-effect: Delete all the indexes not present in the model.json
|
|
324
|
-
Model.syncIndexes(
|
|
324
|
+
Model.syncIndexes().then(
|
|
325
|
+
() => {
|
|
326
|
+
strapi.log.deubg('Mongo sync index call successful.');
|
|
327
|
+
},
|
|
328
|
+
(error) => {
|
|
329
|
+
strapi.log.error('Mongo index sync failed: %o', error);
|
|
330
|
+
}
|
|
331
|
+
);
|
|
325
332
|
} else {
|
|
326
333
|
handleIndexesErrors();
|
|
327
334
|
}
|
package/lib/utils/index.js
CHANGED
|
@@ -122,7 +122,7 @@ module.exports = (mongoose = Mongoose) => {
|
|
|
122
122
|
if (Array.isArray(value)) return value.map(valueToId);
|
|
123
123
|
|
|
124
124
|
if (isMongoId(value)) {
|
|
125
|
-
return mongoose.Types.ObjectId(value);
|
|
125
|
+
return new mongoose.Types.ObjectId(value);
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
return value;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "3.
|
|
6
|
+
"version": "3.12.0",
|
|
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.
|
|
21
|
+
"@akemona-org/strapi-utils": "3.12.0",
|
|
22
22
|
"lodash": "4.17.21",
|
|
23
|
-
"mongoose": "
|
|
23
|
+
"mongoose": "7.0.1",
|
|
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": "5eff2890f97943a724086d37182e1e3815704866"
|
|
58
58
|
}
|