mongodb study notes

 
mongodb startup command (in a cmd window)
Example: mongod -dbpath "E:\db"
 
mongo uses the database ( in another new cmd window)
 
List all databases:
show dbs
 
use a database
use database name
 
View the current database
db
 
 
mongoimport import data
mongoimport --db test --collection restaurants --drop --file primer-dataset.json
--db test which database to import into
--collection restaurants Which collection to import into
--drop clear the collection
--file primer-dataset.json which file
 
 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325021462&siteId=291194637