40.mongo命令行操作数据库
更新:HHH   时间:2023-1-7


1. 登陆数据库

mongo ip:port 


2. 显示数据库

show dbs


3. 进去数据库 

use xxxdb


4. 查询表

show collections


5. 查询数据

db.xxxcol.find()

db.xxxcol.find({"age":20})


6. 模糊查询age like "*20*"

db.xxxcol.find({"age":/20/})


7. 删除

db.xxxcol.remove({"age":/20/})

返回MongoDB数据库教程...