• Post Reply Bookmark Topic Watch Topic
  • New Topic

MongoDB find() operation : Internal working

 
saran harini
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need some clarifications regarding how the find operation in mongoDB will iterate through the documents in db.

The scenario i have :
=============
I have four documents in my db

List of documents:
1. name=aaaa
2. name=aaaa , age = 23, city = madurai
3. name =bbb, age = 34, city = cbe
4. name = ccc, age =24, city = cbe , state = TN

Suppose if i query the document for [city = cbe] I will get documents 3 & 4 in my resultset..
But I want to know whether the query will touch all the four documents or only the documents with city to find this resultset.. Or how does this work??
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!