You can run the MongoDB commands in the Web shell below:
Sample commands:
  1. show dbs
  2. db
  3. use test
  4. db
  5. db.createCollection("log", {capped:true, size:5242880, max:5000})
  6. db.createCollection("contact")
  7. show collections
  8. db.contact.insertOne({name:"DiDi",status:"active"})
  9. db.contact.insert({name:"DiDi",status:"inactive"})
  10. db.contact.find()
  11. db.contact.find().pretty()
  12. db.contact.find({},{name:1})
  13. db.contact.find({},{name:1,status:1})
  14. var item = db.contact.findOne()
  15. item.name
  16. item["name"]
  17. var myCursor = db.contact.find()
  18. printjson(myCursor.next())
  19. printjson(myCursor.next())
  20. var myCursor = db.contact.find()
  21. myCursor.forEach(printjson)
  22. var myCursor = db.contact.find()
  23. var itemArray = myCursor.toArray()
  24. itemArray[0]