locked
how to write joins in mongodb? RRS feed

  • Question

  • User-1669453032 posted

    hi,

    I am developing an application in mvc and mongodb.

    I want to make joins now.

    If  there are some sale orders and each sale order have some products then how can i see the statistics of all my issuance of some product in mongodb ?

    Saturday, July 23, 2016 5:23 PM

All replies

  • Saturday, July 23, 2016 11:07 PM
  • User-1669453032 posted

    thanks . can you guide about performance.?

    and how 'll i get the most issued product ?

    will i have to loop through it or can be get from join ?

    If join then will it slower down or not ?

    Sunday, July 24, 2016 8:48 AM
  • User269602965 posted

    generally if the parent table has primary key that is indexed and the child table has primary key that is indexed and the foreign key that is indexed, performance should be the best the database system (hardware, software) can provide.

    I am not familiar with MongoDB and its ability to optimize query performance like Oracle and MSSQL do for you in the background.

    The join avoids the need to loop as the join becomes like a single virtual table that you extract into your display environment.

    Joins are faster than looping through the child table programmatically looking for matches.

    Monday, July 25, 2016 2:53 AM