@ewb/mongoose-query 1.1.15 → 1.1.16
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/QueryModel.js +1 -1
- package/package.json +1 -1
package/lib/QueryModel.js
CHANGED
|
@@ -205,7 +205,7 @@ export class QueryModel {
|
|
|
205
205
|
const array = doc[key];
|
|
206
206
|
if (array && Array.isArray(array)) {
|
|
207
207
|
if (id) {
|
|
208
|
-
return (array.find((x) => x._id.
|
|
208
|
+
return (array.find((x) => x._id.equals(id)) || null);
|
|
209
209
|
}
|
|
210
210
|
return array[0] || null;
|
|
211
211
|
}
|
package/package.json
CHANGED