MongoDB can be used as a file system, taking advantage of load balancing and data replication features over multiple machines for storing files.
Introduction
In this article we will learn how to find
documents in MongoDB with a practical example
Previous articles have provided an
introduction to MongoDB and the set up and installation, and few command line
options.You can get them from the following:
Objective
The objective of the article is to learn how to use the find
command to retrieve documents from Mongo database.
Will take a look at Query criteria, field selection, and cursor
operations
Finding Documents
In
previous article we have seen the options of querying using different operators.
In this part 2 we will see few more…
Our
animal document contains a tag field and the tags field contains an array of
tags

So let us
see how to match among those…
We can
notice that we are finding the tag field of tag which matches cute

Note:-this
is strictly quality and it also case sensitive
Now let’s
find animals who are cute or in the ocean we will get some animals which are
cute and some which are in ocean but not necessarily both of them as shown
below ….

Now if we
want to insist that there would be both ocean and cute tagged we can issue the
following command by using all operator as shown below…

If we
want to find the document which are none in the tags we can use nin operator as
shown below

Conclusion
In this article we have seen the different ways of finding documents..In coming articles we can see how to use cursor operations
Reference
http://www.mongodb.org/