//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的更多相关文章

  1. mongoDB - 日常操作三

    MongoDB 进程控制 进程控制 db.currentOp() # 查看活动进程 db.$cmd.sys.inprog.findOne() # 查看活动进程 与上面一样 opid # 操作进程号 o ...

  2. mongoDB - 日常操作一

    mongodb 启动方式 # 不启动认证 ./mongod --bind_ip 172.16.2.17 --port --fork --logpath=/opt/mongodb/mongodb.log ...

  3. MongoDB入门(4)- MongoDB日常操作

    MongoDB客户端 MongoDB有很多客户端 MongoVue Robomongo MongoDB命令行 启动mongo shell 在windows下,双击mongo.exe可以启动mongo ...

  4. MongoDB - 日常操作二

    MongoDB 开启认证与用户管理  ./mongo # 先登录 use admin # 切换到admin库 db.addUser(") # 创建用户 db.addUser('zhansan ...

  5. mongoDB - 日常操作四

    python 使用 mongodb easy_install pymongo # 安装(python2.+) import pymongo connection=pymongo.Connection( ...

  6. Linux 日常操作

    Linux 日常操作 */--> Linux 日常操作 Table of Contents 1. 查看硬件信息 1.1. 服务器型号序列号 1.2. 主板型号 1.3. 查看BIOS信息 1.4 ...

  7. MongoDB查询操作限制返回字段的方法

    这篇文章主要介绍了MongoDB查询操作限制返回字段的方法,需要的朋友可以参考下   映射(projection )声明用来限制所有查询匹配文档的返回字段.projection以文档的形式列举结果集中 ...

  8. EasyUI-datagrid数据展示+MongoDB数据操作

    使用EasyUI-datagrid进行数据展示:进行添加,修改,删除操作逻辑代码,数据源来自MongoDB. 一.新建SiteInfo控制器,添加Index页面:http://www.cnblogs. ...

  9. Mongodb Manual阅读笔记:CH2 Mongodb CRUD 操作

    2 Mongodb CRUD 操作 Mongodb Manual阅读笔记:CH2 Mongodb CRUD 操作Mongodb Manual阅读笔记:CH3 数据模型(Data Models)Mong ...

  10. [置顶] MongoDB 分布式操作——分片操作

    MongoDB 分布式操作——分片操作 描述: 像其它分布式数据库一样,MongoDB同样支持分布式操作,且MongoDB将分布式已经集成到数据库中,其分布式体系如下图所示: 所谓的片,其实就是一个单 ...

随机推荐

  1. XXE漏洞初步练手

    0x00:XXE定义 xml外部实体注入被我们称为XXE.因为实体可以通过预定义在文档中被调用,而实体的标识符又可以访问本地或者远程内容,当允许引用外部实体时,攻击者便可以构造恶意内容来达到攻击.

  2. Springboot+Vue实现短信与邮箱验证码登录

    体验网址:http://mxyit.com 示例 1.新增依赖 <!-- 短信服务 --> <dependency> <groupId>com.aliyun< ...

  3. toast简介

    PostgreSQL数据库不允许元组(行,记录)跨越多个页面(page)存储,所以,它不能直接存储非常大的字段值.对于大字段值,它将被压缩且(或)分解为多个物理行,该技术称为"TOAST&q ...

  4. locust 检查点、集合点、参数化设置。

    1.参数化 方式1:循环取数据,数据可以重复使用. 所有并发虚拟用户共享同一份测试数据,各虚拟用户在数据列表中循环取值. 例如,模拟10个用户并发请求网页,总共有4个URL地址,每个虚拟用户都会依次循 ...

  5. springboot docker打包镜像

    首先在idea中创建springboot项目,pom文件packaging 为jar ,然后编写接口. 编写Dockerfile 注意Dockerfile只能这样命名. 使用maven打包命令或者使用 ...

  6. 服务器consul与本地服务健康检查不通问题解决

    (125条消息) 服务器consul与本地服务健康检查不通问题解决_向往鸟的博客-CSDN博客_consul健康检查失败 .MathJax, .MathJax_Message, .MathJax_Pr ...

  7. KingbaseES V8R6集群运维案例之---repmgr standby promote应用案例

    案例说明: 在容灾环境中,跨区域部署的异地备节点不会自主提升为主节点,在主节点发生故障或者人为需要切换时需要手动执行切换操作.若主节点已经失效,希望将异地备机提升为主节点. $bin/repmgr s ...

  8. 19.内容提供者ContentProvider

    之前我们学习了Android数据持久化的技术,包括文件存储(内部存储).SharedPreferences存储以及数据库存储. 这些持久化技术所保存的数据基本都是在当前应用程序中访问. Android ...

  9. python requests 模拟登录

    转载: https://blog.csdn.net/m0_59485658/article/details/128115786

  10. [部署日记]GO在Visual Studio Code初次运行时提示The "gopls" command is not available. Run "go get -v golang.org/x/tools/gopls" to install.

    本以为VSC在商城装上插件后就能拎包入住,F5的时候我当场好家伙 于是无脑Install... Installing github.com/nsf/gocode FAILED Installing g ...