tags:

views:

356

answers:

1

I know that MongoDB is a document style database so queries like select all employees with salary > 32000 aren't its speciality, but I noticed that you can indeed do things like this. My question is, are these queries comparable in performance to what you'd see in an RMDBS?

Also, what about selecting the guts of an object? If you have a Department, and you wanted to get Department.Employees.Manager.Salary, you can use server-side javascript to dive into the object and pull that value out. The feature is there, but is it something that is meant to be used a lot? How does the performance of doing something like this compare to doing a typical join?

+2  A: 

MongoDB uses BTrees just like most RDBMSes, so range queries like the one above should be at least as fast as they are in a typical RDBMS.

mdirolf
wise to use an ensureIndex on your field, of course.
Gregg Lind