| Refresh | Home EGTry.com

mongodb javascript shell


connect to local mongodb

 mongo

show all databaes

 show dbs

switch to an existing database or create a new database

 use egtry

create a record

 db.collection1.insert({path:"/egtry/java", title:"hello"})

list all records of a collection

 db.collection1.find()