1
I have a model of an airport in mysql and I intend to upload it to mongodb via links between collections. In the following images are examples of documents from my collections. (Airplane, Airport and Flight)
The id in Flight is the id_voo, in Airplane is the tailnum and in Airport is idAirport. In mysql the relations are 1:M from Airplane to Flight and 1:M from Flight to airport. I exported this data with foreign keys and I want to cross-reference it between documents in mongodb. Mongo db immediately assigns an objectid as the main one and that’s not what it intended. How can I set this?
That is, you’re intending to make one Join with Mongo?
– ppalacios
Yeah, kind of like that. wanted a way to make a querie that would return me the year of a plane but that where the field diverted was equal to 1. only this field diverted is in the Flight collection
– Gonçalo
So man, I’m sorry to tell you but Mongo doesn’t have the resources to do joins. The paradigm is another. See the answer of the sergiopereira.
– ppalacios