mongo operations
Check Mongo Operate Logs
db.getCollection('oplog.rs').find({'ns':{$in:['sxa.sxacc-organizations','sxa.devices']},'op':{$in:['u','i','d']},'wall':{$gt:new ISODate('2018-05-02T08:40:51')}})
Update Mongo
db.getCollection('sxacc-organizations').update({"_id" : "12605082"},{$set:{"updateSubscriberEnabled":"true"}});
db.getCollection('sxacc-organizations').update({"_id" : "12605082"},{$set:{"updateDeviceEnabled":"true"}});
db.getCollection('sxacc-organizations').update({"_id" : "12605082"},{$set:{"detachDeviceEnabled":"true"}});
db.getCollection('sxacc-organizations').find({"_id" : "12605082"}); – check if the options are set successfully
mongoexport -h localhost --db sxa --collection sxacc-devices --out sxacc-devices.json --query='{"orgId":"57550"}'
mongoimport --host cdtsxacc01.calix.local --db=sxa --collection=sxacc_devices --file=sxacc-devices.json
db.inventory.deleteOne( { status: "D" } )
db.collection.deleteMany(
<filter>,
{
writeConcern: <document>,
collation: <document>
}
)
mongo test --eval "printjson(db.getCollectionNames())"
TODO
mongo operations的更多相关文章
- SpringDataMongoDB介绍(一)-入门
SpringDataMongoDB介绍(一)-入门 本文介绍如何应用SpringDataMongoDB操作实体和数据库,本文只介绍最基本的例子,复杂的例子在后面的文章中介绍. SpringDataMo ...
- MongoDB入门(7)- SpringDataMongoDB
入门 本文介绍如何应用SpringDataMongoDB操作实体和数据库,本文只介绍最基本的例子,复杂的例子在后面的文章中介绍. SpringDataMongoDB简介 SpringDataMongo ...
- MongoDB - MongoDB CRUD Operations, Query Documents, Iterate a Cursor in the mongo Shell
The db.collection.find() method returns a cursor. To access the documents, you need to iterate the c ...
- golang mgo的mongo连接池设置:必须手动加上maxPoolSize
本司礼物系统使用了golang的 mongo库 mgo,中间踩了一些坑,总结下避免大家再踩坑 golang的mgo库说明里是说明了开启连接复用的,但观察实验发现,这并没有根本实现连接的控制,连接复用仅 ...
- MongoDB—— 读操作 Core MongoDB Operations (CRUD)
本文主要介绍内容:从MongoDB中请求数据的不同的方法 Note:All of the examples in this document use the mongo shell interface ...
- MongoDB - The mongo Shell, mongo Shell Quick Reference
mongo Shell Command History You can retrieve previous commands issued in the mongo shell with the up ...
- MongoDB - The mongo Shell, Write Scripts for the mongo Shell
You can write scripts for the mongo shell in JavaScript that manipulate data in MongoDB or perform a ...
- MongoDB - The mongo Shell, Access the mongo Shell Help
In addition to the documentation in the MongoDB Manual, the mongo shell provides some additional inf ...
- MongoDB - The mongo Shell, Configure the mongo Shell
Customize the Prompt You may modify the content of the prompt by setting the variable prompt in the ...
随机推荐
- linux 环境下jmeter+ant+jenkins
一.linux下的jenkins的安装: 下载链接:https://pan.baidu.com/s/1qZItZOC 密码:58da Jenkins 下载网址: http://jenkins-ci.o ...
- OS填空题练习
1.操作系统的基本特征:并发性:共享性:虚拟性:异步性. 2.操作系统的设计目标:方便性:有效性:可扩充性:开放性. 3.操作系统的主要功能:处理机管理:存储器管理:设备管理:文件管理:用户接口. 4 ...
- 日常工作问题解决:rhel7下使用teamd配置双网卡绑定
目录 1.情景描述 2.准备工作 2.1 确认网卡信息 2.2 删除原有网卡配置信息 3.配置网卡绑定 3.1 配置千兆网卡双网卡热备用作心跳 3.2 配置网兆网卡双网卡负载均衡用作业务 1.情景描述 ...
- 乐字节Java构造器(构造方法|构造函数)、方法与内存分析
一. 构造器(构造方法|构造函数) 在创建对象时(new),必会调用一个特殊的方法,这个方法是初始化对象信息的为new服务的.这个方法称为“构造器” 使用 new + 构造方法创建一个新的对象. 构造 ...
- Linux软件安装管理---源码安装
在Linux平台下,软件包的类型可以划分为两类:源码包.二进制包. 源码包: 即程序软件的源代码(一般也叫Tarball,即将软件的源码以tar打包后再压缩的资源包). 二进制包: 如 Red Hat ...
- [转帖]谷歌TF2.0凌晨发布!“改变一切,力压PyTorch”
谷歌TF2.0凌晨发布!“改变一切,力压PyTorch” https://news.cnblogs.com/n/641707/ 投递人 itwriter 发布于 2019-10-01 12:38 评论 ...
- 并行forearch的使用及测试(Parallel.Foreach)
using System; using System.Collections.Generic; using System.Diagnostics; using System.Threading.Tas ...
- K8S从入门到放弃系列-(6)kubernetes集群之kube-controller-manager部署
摘要: 1.Kubernetes控制器管理器是一个守护进程它通过apiserver监视集群的共享状态,并进行更改以尝试将当前状态移向所需状态. 2.kube-controller-manager是有状 ...
- jmeter XLSX 读取
import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.apache.poi.xssf.usermodel.XSSFSheet; i ...
- Python之字符与编码笔记
概述 类型 str 字符串 bytes 字节 bytearray 字节数组 字符串编码架构 字符集:赋值一个编码到某个字符,以便在内存中表示 编码 Ecoding:转换字符到原始字节形式 解码 Dec ...