MongoDb

From Objectif Client Inc
Revision as of 04:30, 6 January 2017 by Nicolas Rollin (talk | contribs)
Jump to navigation Jump to search

Cheat sheet

  • Connect to a mongodb
mongo
  • Display dabases
show dbs
  • Connect to a database
use database
  • List Tables (Collections)
show collections
  • Display content of a table
db.collection.find()
  • Remove Tables (Collections)
db.collection.drop()
  • Remove Database (Collections)
db.dropDatabase()

Http Interface

Inable Http Interface

add http.enabled: true in /etc/mongod.conf

net:
  port: 27017
  bindIp: 127.0.0.1
  http.enabled: true
  http.RESTInterfaceEnabled: true

Access to htps interface

Http Interface