常用的mongodb数据库操作指令

启动后台芒果数据库

A.指令  mongodb -version

B.mongod localhost:27017或mongod 127.0.0.1:27017

1.显示mongodb中的数据库操作指令:show   dbs    (show:显示;dbs:database数据库)

2.创建数据库:use 库名称

3.查询数据库:db.student.find()    (student:数据库名称)

4.创建数据库中的表  

扫描二维码关注公众号,回复: 8334982 查看本文章

   (1)先选中所在的数据库

   (2)在选中的数据库下创建表(存放在数据记录的)

 指令:db.createCollection('表名称')

5.删除指令:db.student.remove()

6.插入指令:db.student.insert()

猜你喜欢

转载自www.cnblogs.com/sdfdfd/p/12109468.html