Just follow the instructions for your specific device OS from this link. I currently use Mac OS X. My notes reflect usage of environment. YMMV.
Verify that your install is correct by running the MongoDB server on your local machine as described here. Make sure that the local PATH is set to include the location of the mongod and mongo binaries from this distribution.
mkdir -p /data/mydb --> identify local db location
chmod u=rwx /data/mydb --> give user read/write access to db
mongod --dbpath /data/mydb --> run the Mongo daemon
At this point, the mongodb database server (daemon) is running.
Use the mongo utility to connect to the mongodb server and open a shell for interactions.
mongo
MongoDB shell version: 2.6.4
connecting to: test
>
You should see the above output, followed by a prompt for commands.
The mongo shell is a powerful, interactive interface for viewing, querying and maintaining all MongoDB databases on the connected server. Check this page for a comprehensive reference to the mongo shell commands.
Explore available menu options with the 'help' command.
> help
db.help() help on db methods
db.mycoll.help() help on collection methods
sh.help() sharding helpers
rs.help() replica set helpers
help admin administrative help
help connect connecting to a db help
help keys key shortcuts
help misc misc things to know
help mr mapreduce display on shell
....
exit quit the mongo shell
>
You can quit the shell at any time with exit.
For convenience, here are the most frequently used shell commands.
The following commands are used on a specific collection (where myColl should be replaced by the appropriate collection that you are running these commands on)
This is a list of frequently used commands for basic CRUD (create, read, update, delete) operations that most applications require.