docker中使用mongo命令显示命令未找到

docker ps
docker exec -it 098e580a70f6 bash
mongosh

是因为Mongodb 6.0版本之后命令从mongo改为mongosh

mogondb中的一些查找、删除命令:

show dbs

use xxx

show collections

db.collectionName.find()  // 查看集合中的所有数据

db.collectionName.remove({})    // 删除所有数据但保留集合

https://blog.csdn.net/m0_37298500/article/details/121521505

posted @ 2024-07-31 21:01  AI未来10Y  阅读(1)  评论(0编辑  收藏  举报