mongoDB日常操作01
//serialno_info.i,查看历史最大值
db.serialno_info.find({'_id':'define_picture'})
//查看文件记录有序id条数
db.fs.files.find({$where:"(this._id.length < 10)"}).count()
//查看文件记录id有序且文件类型为pdf条数
db.fs.files.find({$where:"(this._id.length < 10)",'filename':{$regex:'pdf'}}).count()
//查看文件系统有序id条数
db.fs.chunks.find({$where:"(this.files_id.length < 10)"}).count()
//查看文件记录id有序且在文件系统中无对应记录 的所有记录
db.fs.files.find({$where:"(this._id.length < 10)",'_id':{$nin:db.fs.chunks.distinct('files_id')}})
//查看文件系统id有序且在文件记录中无对应纪录 的所有记录
db.fs.chunks.find({$where:"(this.files_id.length < 10)",'files_id':{$nin:db.fs.files.distinct('_id')}})
//customer_info cwd_customer_info.protocol
db.customer_info.find({'cwd_customer_info.protocol':{$exists:true}},{'cwd_customer_info.protocol':1})
//customer_info jzd_customer_info.o2
db.customer_info.find({'jzd_customer_info.o2':{$exists:true}},{'jzd_customer_info.o2':1})
//customer_info yfd_customer_info.customer_info.protocol
db.customer_info.find({'yfd_customer_info.customer_info.protocol':{$exists:true}},{'yfd_customer_info.customer_info.protocol':1})
//students_idnyc_info students_idnyc_info.o1
db.students_idnyc_info.find({'students_idnyc_info.o1':{$exists:true}},{'students_idnyc_info.o1':1})
//partner_smk_oder partner_smk_order.o1
db.partner_smk_oder.find({'partner_smk_order.o1':{$exists:true}},{'partner_smk_order.o1':1})
//pxfq_business_info pxfq_business_info.protocol
db.pxfq_business_info.find({'pxfq_business_info.sign_protocol':{$exists:true}},{'pxfq_business_info.sign_protocol':1})
//customer_info customer_info.protocol
db.customer_info.find({'customer_info.protocol':{$exists:true}},{'customer_info.protocol':1})
//customer_info customer_info.o1
db.customer_info.find({'customer_info.o1':{$exists:true}},{'customer_info.o1':1})
//customer_info zffq_customer_info.o1
db.customer_info.find({'zffq_customer_info.o1':{$exists:true}},{'zffq_customer_info.o1':1})
//partner_customer_info partner_customer_info.[*].o1
统计测额人数
db.customer_info.find({'customer_info.market':'ERWED','customer_info.l':{$exists:true}}).count()
测额总量
db.customer_info.aggregate([
{
'$match':{'customer_info.market':'ERWED'}
},
{
'$group':{
'_id': null,
'sum':{$sum:'$customer_info.l'}
}
}
])
对字符大于小于做条件查询
db.lcpt_group_info.find({
$where:'this.lcpt_group_info.cgsize && parseInt(this.lcpt_group_info.cgsize) >= 4'
})
去重查询,json形式,如果要去重查询总数,在后面加 .values.length
db.runCommand({'distinct':'erwed_customer_info','key':'erwed_customer_info.company_name'}).values.length
mongoDB日常操作01的更多相关文章
- mongoDB - 日常操作三
MongoDB 进程控制 进程控制 db.currentOp() # 查看活动进程 db.$cmd.sys.inprog.findOne() # 查看活动进程 与上面一样 opid # 操作进程号 o ...
- mongoDB - 日常操作一
mongodb 启动方式 # 不启动认证 ./mongod --bind_ip 172.16.2.17 --port --fork --logpath=/opt/mongodb/mongodb.log ...
- MongoDB入门(4)- MongoDB日常操作
MongoDB客户端 MongoDB有很多客户端 MongoVue Robomongo MongoDB命令行 启动mongo shell 在windows下,双击mongo.exe可以启动mongo ...
- MongoDB - 日常操作二
MongoDB 开启认证与用户管理 ./mongo # 先登录 use admin # 切换到admin库 db.addUser(") # 创建用户 db.addUser('zhansan ...
- mongoDB - 日常操作四
python 使用 mongodb easy_install pymongo # 安装(python2.+) import pymongo connection=pymongo.Connection( ...
- Linux 日常操作
Linux 日常操作 */--> Linux 日常操作 Table of Contents 1. 查看硬件信息 1.1. 服务器型号序列号 1.2. 主板型号 1.3. 查看BIOS信息 1.4 ...
- MongoDB查询操作限制返回字段的方法
这篇文章主要介绍了MongoDB查询操作限制返回字段的方法,需要的朋友可以参考下 映射(projection )声明用来限制所有查询匹配文档的返回字段.projection以文档的形式列举结果集中 ...
- EasyUI-datagrid数据展示+MongoDB数据操作
使用EasyUI-datagrid进行数据展示:进行添加,修改,删除操作逻辑代码,数据源来自MongoDB. 一.新建SiteInfo控制器,添加Index页面:http://www.cnblogs. ...
- Mongodb Manual阅读笔记:CH2 Mongodb CRUD 操作
2 Mongodb CRUD 操作 Mongodb Manual阅读笔记:CH2 Mongodb CRUD 操作Mongodb Manual阅读笔记:CH3 数据模型(Data Models)Mong ...
- [置顶] MongoDB 分布式操作——分片操作
MongoDB 分布式操作——分片操作 描述: 像其它分布式数据库一样,MongoDB同样支持分布式操作,且MongoDB将分布式已经集成到数据库中,其分布式体系如下图所示: 所谓的片,其实就是一个单 ...
随机推荐
- textfsm
from concurrent.futures import ThreadPoolExecutor import netmiko import os from threading import Loc ...
- PS设计非常漂亮酷炫的金色字体效果
方法/步骤 1.在PS里面新建一个黑色背景 2.在图层上 写上比较粗一点的字. 3.鼠标右击图层,选择混合模式,进行调整. 选择颜色叠加,注意颜色是深黄色. 4.转移到混合模式里面的渐变叠加,渐变的颜 ...
- React子组件继承父组件的props
https://zh-hans.reactjs.org/warnings/unknown-prop.html
- tesseract-ocr 安装、语言库、使用 随记
前几日才听说ocr的图片识别功能.觉得很有意思.先体验一下. 地址: GitHub - tesseract-ocr/tesseract: Tesseract Open Source OCR Engin ...
- 【RTOS】RTOS汇编入门 (1)
引言 为了提高效率,进行更为底层的操作,RTOS常采用汇编语句,因此了解常用的汇编语句,很有必要 汇编指令 1..equ:类似于c中的#define,表声明常量 例如:.equ PSW 0x10000 ...
- NLog日志 富文本编辑器
NLog日志 NLog是什么 NLog是一个基于.NET平台编写的类库,我们可以使用NLog在应用程序中添加极为完善的跟踪调试代码.NLog是一个简单灵活的.NET日志记录类库.通过使用NLog,我们 ...
- 谷歌是如何改进 GKE、Cloud Run 的 gVisor 文件系统性能的?
灵活的应用程序架构.CI/CD 管道和容器工作负载通常运行不受信任的代码,因此应该与敏感的基础设施隔离.一种常见的解决方案是部署纵深防御产品(如使用gVisor的GKE Sandbox)以通过额外的保 ...
- ES 基础操作
集群 健康值的三种状态 Green:所有索引的所有分片均可用 primary 和 replice 均可用. Yellow 至少有一个 replice不可以用, 但是所有的 primary 正常. Re ...
- 关于Salesforce存在至于项目的选择List的取值问题
概要: 我们在做项目的时候,经常会遇到一个问题: 一个选择List字段的可选项被另一个选择List制约,这种情况如何在后台取得这两者的对应关系. 原文在这里(侵删): Apexで連動項目の選択肢を取得 ...
- debian最小化安装+sway记录
1. 最小化安装系统,只安装最基础的系统,如果是虚拟机中安装,安装SSH服务器可能更方便在宿主机终端操作客户机.deiban的安装器里有提供基础工具包的安装项,如果为了系统纯净不安装,可能会导致更多不 ...