I am currently evaluating mongodb for a project that I started, but I cannot find any information on what the equivalent of SQL representation in mongodb would be. What I need that the SQL view provides is to combine data from different tables (collections) into one collection.
I want nothing but merge some documents together and mark them as one document. Here is an example:
I have the following documents: cc_address us_address billing address shipping_address
But in my application, I would like to see all my addresses and be able to manage them in one document.
In other cases, I may just want a couple of fields from collections:
I have the following documents: fb_contact twitter_contact google_contact reddit_contact
Each of these documents has fields that are aligned, for example, first name and surname firstname, but also have fields that are not aligned. I would like to compile them into a single document that contains only fields that are aligned.
Can this be done using SQL views correctly? Can I execute this function in MongoDb?
source share