Mongodb – How do I make a script that cleans up objects from one document if they don't exist in another?
I have the following two collections, Player and Team. These two collections each contains lots of documents. Here is an example with some dummy data: Player _id: ObjectId('6098c5ab615d9e23543d0f6e'), name: 'Frank', age: 27, position: 'striker' _id: ObjectId('61409537c4f113354782eea3'), name: 'Jan', age: 19,…