Answer the question
In order to leave comments, you need to log in
How to do a search in MongoDB as a result of a search?
Is it possible to do a MongoDB lookup as the result of another lookup?
Something like this:
db.table.find({...}).find({...})
Answer the question
In order to leave comments, you need to log in
You can use aggregation framework
db.col.aggregation({$match:{}},{$match:{}})
will be exactly what you need
I'm afraid to ask: why do you need it? It is possible to unite in one find ().
In general, the find() method returns a cursor object. Methods available on this object: docs.mongodb.org/manual/reference/method/js-cursor
As you can see, the find() method is not among them. So the answer is - You can't do that.
A simple abstract example: we have a database of a million records. And there is a big loop:
for x in range(1 000):
db.table.find({...}) // При каждой итерации делаем выборку из миллиона записей
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question