2014년 12월 27일 토요일

How to create join between collections?

How to create join between collections by means of the function of aggregation



Hi Erick,

The concept of aggregation isn't to connect collections through joins (which basically isn't possible in Mongo AFAIK), but to group and yes, aggregate, data to form, if you will, different data. The aggregation system was created to simplify your application logic, when it comes to the aggregation of data. Here is a link to the docs explaining the aggregation framework.




Thank you Scott,

as having read in a literature that the function of aggregation is the synonym of the select in SQL I thought that also could carry out to him some join with other collections



Nope, and the missing joins are one of the points of attack, which "non-believers" (I hate the word haters:-)) of Mongo and other document stores always use to say the technology can't work or it works poorly. But at the same time, they don't acknowledge that the joins are what cause RDBMSes to become costly behemoths, when they have to scale to handle very large data sets. When done right, Mongo documentsa can be modeled to avoid a lot of unnecessary joining through denormalization, which means faster queries and also more aggregation possibilities on a lot of data. You see, when using Mongo, you have to partially step away from the data normalization paradigm we've been stuck in for so many years. Once you get it (and you'll have to keep getting it too), then it will go "click" and you probably won't be looking too much back at SQL. There are some instances, where SQL is a better solution, but these cases are, in my eyes, thankfully getting rarer. And, and this is big and, now with IoT becoming the next paradigm shift in computing, SQL datastores will become the less common ones. I am fairly certain of this.


댓글 없음:

댓글 쓰기