//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. USB设备判断接入和移除

    目录 以沁恒的CH582芯片为例,主机模式下,在R8_USB_INT_EN中可以使能RB_UIE_DETECT位,由中断来提醒检测USB设备的接入和移除:从机模式下,USB设备没有这样的中断功能(上述 ...

  2. Linxu后台运行Java的jar包

    1.直接运行 java -jar myjar-0.0.1-SNAPSHOT.jar 这种方式需要一直挂载终端(Ctrl+C会结束进程.关闭shell也会结束进程),故不符合需求 2.后台运行 A.Ct ...

  3. Java控制流程(复习)

    流程控制语句 流程控制语句包括:顺序结构,分支结构,循环结构 分支结构 if语句: 第一种: if(关系表达式){ 语句体 } else{ 语句体2 } 第二种: if (){ } else if ( ...

  4. QT--QMainWindow窗口的状态栏设置

    QMainWindow窗口状态栏 实时显示时间: 1.获取实时时间使用定时器QTimer, QTimer *timer = new QTimer(); connect(timer, &QTim ...

  5. IO流(1)

    IO流(1) 目录 IO流(1) 文件 创建文件 获取文件信息 目录的操作和文件删除 文件 文件流 文件在程序中以流的形式来操作 输入流:数据从数据源(文件)到程序(内存)的路径 输出流:数据从程序( ...

  6. 如何用premiere添加配乐?pr视频添加音乐

    在pr中,怎么给视频添加音乐? 给视频添加音乐,有两种情况:1是视频音乐已存在:2是视频没有音乐,只是单纯的视频. 1.从酷狗音乐里下载一首音乐到桌面. 2.将音乐文件直接拖动到音频轨道里,把素材面板 ...

  7. 直播带货源码,flutter 顶部滚动栏+页面

    直播带货源码,flutter 顶部滚动栏+页面 tabPage.dart import 'package:flutter/cupertino.dart';import 'package:flutter ...

  8. Nginx的重写功能——Rewrite

    Nginx的重写功能--Rewrite https://huaweicloud.csdn.net/63566cced3efff3090b5f470.html?spm=1001.2101.3001.66 ...

  9. QE11 / QE51N 界面太小问题

    修复后界面是,修复前常规页签中的数据只能显示4行,需要的note是 2639352 , SNOTE 进行打补丁就好  note是 2639352

  10. 如何为 Debian 11 安装图形用户界面 (GUI)

    如何为 Debian 11 安装图形用户界面 (GUI) allway2 于 2021-12-26 17:30:14 发布 11767 收藏 23文章标签: debian 服务器 linux版权 华为 ...