Closed soullivaneuh closed 1 year ago
Make a query like so:
const relatedUsers = await app.service('users').find({ query: { _id: { $in: [ 'mongoid-1', 'mongoid-2', 'mongoid-3', ], }, paginate: false, });
Considering the referenced id are valid.
Having 3 items as a result.
Empty result.
This is because the query values are not converted onto ObjectId as expected, the adapter only handle simple cases: https://github.com/feathersjs-ecosystem/feathers-mongodb/blob/c8e894cd433b39e5dc92ac824a983944768d25eb/lib/index.js#L120
ObjectId
I am currently working on a fix for that.
In v5 this has been addressed with the ObjectId keyword and converter.
Steps to reproduce
Make a query like so:
Considering the referenced id are valid.
Expected behavior
Having 3 items as a result.
Actual behavior
Empty result.
Root cause
This is because the query values are not converted onto
ObjectId
as expected, the adapter only handle simple cases: https://github.com/feathersjs-ecosystem/feathers-mongodb/blob/c8e894cd433b39e5dc92ac824a983944768d25eb/lib/index.js#L120I am currently working on a fix for that.