xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

MongoDB Up and Going All In One

MongoDB Up and Going All In One

cloud editor / cloud ide

https://ide.c9.io/xgqfrms/mongodb

MongoDB 教程

https://www.runoob.com/mongodb/mongodb-tutorial.html

# start
# server
$ mongod --dbpath /System/Volumes/Data/data/db

# stop
$ mongod --shutdown
# Ctrl + C
# kill <mongod process ID>

# Shut down the mongod from the mongo shell using the db.shutdownServer() method as follows:
> use admin
> db.shutdownServer()

https://docs.mongodb.com/manual/tutorial/manage-mongodb-processes/#stop-mongod-processes

# client
$ mongo

# 查看所有数据库
> show databases;
> show dbs;

> show dbs

# 数据库不存在,则创建数据库,否则切换到指定数据库
> use test

> db.test.insert({"name":"xgqfrms"})

# 创建集合,类似SQL数据库中的表
> db.createCollection("table")

# 查看集合
> show collections

> show tables

# 删除集合
> db.collection.drop()

# 删除当前数据库
> db.dropDatabase()

https://zzk.cnblogs.com/my/s/blogpost-p?Keywords=MongoDB

(🐞 反爬虫测试!打击盗版⚠️)如果你看到这个信息, 说明这是一篇剽窃的文章,请访问 https://www.cnblogs.com/xgqfrms/ 查看原创文章!

refs



©xgqfrms 2012-2021

www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!

原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!


posted @ 2016-12-31 23:57  xgqfrms  阅读(52)  评论(2编辑  收藏  举报