Being new to MongoDB environment, I have few questions regarding objectID. I imported two different json files into the database. For example, one of the collections is called animals. The other one contains the owner information like name, location, phone number.
Animals:{
animalType: "cat",
age: 2
}
Owner:{
name: "John",
location: "New York",
phone: "974-234-2333"
}
I understand that MongoDB assigns two different objectID, because one they don't have an objectID assign and being two different collections it will randomly assign an objectID. How do I make sure that ObjectID in the owner collection is the same as the one in animals collections for me to be able to run join query?
Since both of the collections have different objectID, they can't really communicate with one another.