-
mongodb常用命令:
查看数据库命令:
show dbs;
查看集合命令:
show collections;
切换数据库:
use databaseName;
查询数据:
db.集合名.find()
插入数据:
db.集合名.insert({name:'test',age:1});
删除:
db.test.remove();6、更新一条文档记录db.[collection].update({查询条件},{$set:{更新内容}})db.deviceActive.remove({})查询多个db.collection.find({"A":{"$in":[1,2,3]}})db.deviceActive.find({"timestamp":{$gte:1619712000,$lt:1620316800},"channelId":{$regex:'fhyy-htlbdjhxxl-Cb'}}).count()db.userLogin.aggregate({$match:{timestamp:{$gt:1579276800,$lte:1579363199}}},{
mogodb 客户端命令操作
最新推荐文章于 2025-05-27 13:02:49 发布