Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

MongoDB find() operation : Internal working  RSS feed

saran harini
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??
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!