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

  1. SpringDataMongoDB介绍(一)-入门

    SpringDataMongoDB介绍(一)-入门 本文介绍如何应用SpringDataMongoDB操作实体和数据库,本文只介绍最基本的例子,复杂的例子在后面的文章中介绍. SpringDataMo ...

  2. MongoDB入门(7)- SpringDataMongoDB

    入门 本文介绍如何应用SpringDataMongoDB操作实体和数据库,本文只介绍最基本的例子,复杂的例子在后面的文章中介绍. SpringDataMongoDB简介 SpringDataMongo ...

  3. 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 ...

  4. golang mgo的mongo连接池设置:必须手动加上maxPoolSize

    本司礼物系统使用了golang的 mongo库 mgo,中间踩了一些坑,总结下避免大家再踩坑 golang的mgo库说明里是说明了开启连接复用的,但观察实验发现,这并没有根本实现连接的控制,连接复用仅 ...

  5. MongoDB—— 读操作 Core MongoDB Operations (CRUD)

    本文主要介绍内容:从MongoDB中请求数据的不同的方法 Note:All of the examples in this document use the mongo shell interface ...

  6. 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 ...

  7. 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 ...

  8. 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 ...

  9. 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  ...

随机推荐

  1. 怎么让桌面存到d盘

    1.找到桌面文件夹. (C:\Users\Administrator) [C盘],[用户].[“”系统账号“(如Administrator)文件夹],[桌面] 2.打开桌面文件夹的属性. 查看位置,修 ...

  2. java日志框架系列(5):logback框架appender详解

    1.appender 1.什么是appender Appender 是负责写记录事件的组件. Appender 必须实现接口“ch.qos.logback.core.Appender”.该接口的重要方 ...

  3. Java基础---Java常量

    常量:在程序运行期间不变的量 分类: 类型  含义 数据举例 整数常量 所有整数 0,1, 567, -9 小数常量 所有小数 0.0, -0.1, 2.55 字符常量 单引号引起来,只能写一个字符, ...

  4. Centos7.3安装nexus12.1

    nexus.12.1-01的安装             1.下载nexus             2.上传到服务器/root/             3.解压                 t ...

  5. Java中编码问题

    在开发过程中经常会遇到一会乱码问题,不是什么大问题,但是也挺烦人的,今天来将我们开发总结的经验记录下来,希望可以给大家一些帮助. 一些概念: 字符:人们使用的记号,抽象意义上的一个符号.比如:‘1’, ...

  6. Docker系列5--一些问题及解决

    1. 存储问题 1.1 挂载目录权限问题 在使用swarm创建服务的时候要挂载存储来获取运行文件,及写日志出去. 可运行文件相当于在集群中所有地方应该都能访问到,所以使用了NFS文件系统,在集群中所有 ...

  7. Java 中的锁原理、锁优化、CAS、AQS 详解!

    来源:jianshu.com/p/e674ee68fd3f 1.为什么要用锁? 锁-是为了解决并发操作引起的脏读.数据不一致的问题. 2.锁实现的基本原理 2.1.volatile Java编程语言允 ...

  8. (一)Struts2 基础

    一.Struts简介 1.1 历史 虽然Struts 2号称是一个全新的框架,但这仅仅是相对Struts 1而言.Struts 2与Struts 1相比,确实有很多革命性的改进,但它并不是新发布的新框 ...

  9. GIL锁、进程池与线程池、同步异步

    GIL锁定义 GIL锁:Global Interpreter Lock  全局解释器 本质上是一把互斥锁 官方解释: 在CPython中,这个全局解释器锁,也称为GIL,是一个互斥锁,防止多个线程在同 ...

  10. Java 之 LinkedMap 集合

    LinkedHashMap 概述 java.util.LinkedHashMap<k,v>集合 extends HashMap<k,v>集合 LinkedHashMap的特点: ...