Monday, 9 April 2018

How to $pull ObjectId's from multiple collections simultaneously?

I have a mongo db of hundreds of different Users. Some fields contain the ObjectId of different users in Array form.When I delete a user I need to search every collection and delete any references to the deleted user by $pull ing their ObjectId from all relevant fields.Any thoughts on the sort of query I would need to run? Thanks a lot!

Submitted April 09, 2018 at 12:26PM by laura808s

No comments:

Post a Comment