mongo查询命令
db.t_comment.find({ object_id: 6, object_type: "topic", status: 0, replied_comment_id: null }) .sort({ _id: -1 }) .limit(100) db.playCompleted.aggregate([{$match:{_id: 3046695,}},{ $unwind:"$records"},{$match:{$records.completeCount:1}}] ) db.t_comment.find({ object_id: 14, object_type: "topic", status: 0, topic_reply_id: "5f2bc38d9da72a000eea3150" }) .sort({ _id: -1 }) .limit(100) db.t_info.find().count(); db.t_info.find({ detailType: 1 }) .sort({ _id: -1 }) .limit(100) db.resource.update({oldId:"1"},{$set:{"mainType":1}}) db.resource.updateMany({type:{$in:[1,4]}},{$set:{"businessZone":1}}) db.resource.updateOne({ _id: ObjectId("639971631d5ed1320fd87485") }, { $set: { "authorIds": [ "6392d6b7e836f33968d95368" ] } }); db.getCollection('resource').aggregate([{$match:{type:{$in:[1,4]}}}, {$group: { _id : '$oldId', count: { $sum : 1 } } },{$match: {count:{ $gt : 1}}}]) db.t_team.find({teamMembers:{$elemMatch:{userId:11111}}}}) db.resource.update({oldId:"1"},{$set:{"mainType":1}}) db.t_comment.find({ object_type: "topic", user_id: 418279610, status: 0 }) .sort({ _id: -1 }) .limit(100) db.resource.find({ type: { $in: [1,4,20] }, publishStatus:1, auditStatus:2, classifyIds:{$exists:false} }).count(); db.resource.find({ type: { $in: [1,4,20] }, delFlag:false, publishTime:{$lt:ISODate("2023-07-28T00:30:00.000+08:00")}, classifyIds:{$nin:["5f4e75909c215b58a2350577","62b435cbd6a314240e653e3d","627a194a0e9acb4305798d03","5ee0ec8d747f4ec79984e535","627a178e975649281a19fdce","6285a6820e9acb4305798db4","627a16ed975649281a19fdcd","6285a66f0e9acb4305798db3","627a1869975649281a19fdcf","6285a65a8f9ce003b059395e","627a190b0e9acb4305798d02","6285a68d975649281a19fe74","627a175f0e9acb4305798d01","6285a678eb29f35d5706b330"]} })count(); 切分数据后,再查下 db.playCompleted.aggregate([{$match:{_id: 3046695}},{$unwind:"$records"}, {$match:{'records.completeCount':{$exists:false}}}]) 统计数量 db.t_resource_id.find({ objectType: 10, subType: 2 }).count(); db.resource.find({ type: { $in: [2,7] } }).count(); 创建集合,创建索引 db.createCollection("t_mobile_device"); db.t_mobile_device.createIndex({mobile: 1}, {background: true}); db.t_mobile_device.createIndex({sm_device_id: 1}, {background: true}); db.t_mobile_device.createIndex({relateType: 1}, {background: true}); db.t_mobile_device.createIndex({create_time: 1}, {background: true}); db.t_team.find({teamMembers:{$elemMatch:{userId:11111}}}}) 启动服务 cd /usr/local/mongodb/mongodb-linux-x86_64-rhel70-4.2.8/bin/ mongod --config ../mongodb.conf
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· Docker 太简单,K8s 太复杂?w7panel 让容器管理更轻松!
2018-09-19 Intellij Idea 2017 字体模糊解决方案