Create a /etc/yum.repos.d/10gen.repo file to hold information about your repository.
[10gen]
name=10gen repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64
gpgcheck=0
enabled=1
Issue the following command as root to install the latest stable version of MongoDB and the associated tools:
yum install mongo-10gen mongo-10gen-server
These packages configure MongoDB using the /etc/mongod.conf fiile.
This MongoDB instance will store its data files in the /var/lib/mongo and its log files in /var/log/mongo, and run using the mongod user account.
From a system prompt, start mongo by issuing the mongo command.
When you query a collection, MongoDB returns a "cursor" object that contains the results of the query.
The it operation allows you to iterate over the next 20 results in the shell.
You can manipulate a cursor object as if it were an array.
You can constrain the size of the result set to increase performance by limiting the amount of data your application must receive over the network. To specify the maximum number of documents in the result set, call the limit() method on a cursor.
No comments:
Post a Comment