So here is the Problem:
I have document in collection A, when it is first created it is not referenced by any other documents. At some point a document in collection Bwill be created and it will reference the ObjectId of a document in collection A.
What is the best way to find all Documents in Collection A that aren't referenced by I document in collection B?
I understand MongoDB doesn't support joins, but I wonder if there is a solution to this problem other than getting all referenced ObjectIds from Collection B and finding documents in collection A that aren't in that list, as this solution likely wouldn't scale well.
Can I just embed the document from Collection A into the document from collection B and then remove it from Collection A? Is that the best solution?
Thanks for your help and comments.