Open devdebonair opened 8 years ago
I have the same problem here. Is this implemented or is not supported?
@devdebonair
I found something that may help.
Passing an new ObjectID('random ObjectID')
to find
does work, but using the latest mongodb
package is incompatible, switching to the same version camo
is using (2.0.42) works.
import { ObjectID } from 'mongodb';
DB.then(() => {
Character
.find({
owner: new ObjectID('some random ID')
})
.then(res => res.map(u => u.toJSON()))
});
No matter what this always comes back as an empty array and I am sure the document is in the database. When I pass the find function an ObjectID(), I get an error stating that the argument must be a string. I am able to find it in the console through this command.
db.tickets.find({ "_id": ObjectId("random ObjectID") })
Any ideas why this may be happening?