C
C
Coder3212017-09-25 02:15:04
MongoDB
Coder321, 2017-09-25 02:15:04

How to search by _id when aggregating?

I'm trying to master aggregation and immediately stumbled upon a problem, when I try to search by id I get an error

.aggregate([{$match: {app: new ObjectId(OBJECT_ID) }}])

with this option, I constantly get the error "error: TypeError: Argument must be a string" in response. How to fix?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Mylchenko, 2017-11-30
@ERrorMAKros

Friends, I am very interested in the answer to this question! Tell me - was a solution found and if so - ... please tell me what and how ?!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question