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 ...
随机推荐
- IntelliJ IDEA 简单设置
1.在idea中添加try/catch的快捷键 ctrl+alt+t 2.主题修改 选择菜单栏“File--settings--apperance--theme”,主题选择Darcula: 3.代码字 ...
- wxPython之BoxSizer
1 函数原型 sizer = wx.BoxSizer( integer orient ) 其中的方向(orient)可以是 wx.VERTICAL(垂直) 或 wx.HORIZONTAL(水平). 将 ...
- layer弹出层,结合art-template实现弹出编辑
模板 <!-- 模板 --> <script id="render-tpl" type="text/html"> <div cla ...
- mac 10.14.5 [vue create的时候 mkdir没有权限]
1.vue create的时候 mkdir没有权限 2.第一步.先检查系统是否开启了安全模式 csrutil status 3.如果是disabled.进去步骤5,直接查看文件夹权限.如果是enabl ...
- oracle中row_number()的用法
公司系统升级的时候需要数据迁移,遇到一个问题:新表的数据结构和旧表异构,旧表是流水号,新表是联合主键(业务号码+业务号码序号) 最后发现用窗口函数 row_number() + partition b ...
- selenium cookie 登录
前言 爬虫方向的小伙伴们都知道网页爬虫经常遇到的问题就是登录账户,有些简单的网站我们可以简单的send key来输入账户密码就可以登录,但是有很多网站需要验证码之类的就不太好用了,这时候就体现到了co ...
- popcorn-js视频Video框架简单用法
<div> <video class="video" id="ourvideobig" preload="auto" co ...
- 解决GitHub下载慢问题,不用修改HOSTS文件
写这篇文章缘由是我用的一款Github上的软件软件版本更新,想去Github上下载新的版本,结果下载速度居然只有几k,还老是下载失败,然后去修改HOSTS文件(我看文章基本都是叫修改这个),修改完成后 ...
- CSS3中三种清除浮动(float)影响的方式
float是HTML中布局的一大关键,很多难题一旦用上float都能很愉快地解决.但是凡是好用的,也容易出错.比如当子元素都为float时,其父元素会受影响,或者偶尔会发现自己某个div的高度变成了0 ...
- (十五)SpringBoot之使用Redis做缓存数据
一.添加Redis依赖 <?xml version="1.0" encoding="UTF-8"?> <project xmlns=" ...