When querying a sharded collection, can I filter on shard keys using an operator?

42 Views Asked by At

I need to update many documents in a Mongo collection sharded on the _id field. I already have the IDs available in a list. Can I update the documents using something like .update_many({"_id": {"$in": ids_to_update}}, ..., or should I instead use bulkWrite to create an updateOne operation for every ID?

0

There are 0 best solutions below