1

Using node/mongodb/mongoose, how do I retrieve a set of records via an array list of their IDs.

Have had no luck with:

var ids = ['50829a8f558866ad21000921',
    '50829a8f558866ad21000920',
    '50829a8f558866ad2100091d',
    '50829a8f558866ad21000915',
    '50829a8f558866ad2100090b',
    '50829a8f558866ad21000906'];

Schema
    .find()
    .in("_id", ids)
    .run(callback);

Guessing Query.in() is not the way to go.

1 Answer 1

1

Got it...

Schema
    .find({"_id": {$in: ids}})
    .run(callback);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.