I have an array of ObjectIDs, representing _id values for documents in a collection:
ObjectID[] documentsAffected
How can I prepare a query to return all the documents that are referenced in this array?
I have looked at the following but it only works with individual values, not arrays:
Query.EQ("_id", documentsAffected)
I don't want to write a for loop and have to return one document at a time either, because I then need to update these documents in the same way and this seems inefficient when I could update them all in one statement after retrieving them all.
Is there a way to effectively do this? If not, is there another way to return all documents based on some list of items that reference them?