mongodb 查询要点说明
来源:互联网 发布:靠谱的日本代购淘宝店 编辑:程序博客网 时间:2024/06/05 13:29
1.find()
var cursor = collection.find(query, [fields], options);
cursor.sort(fields).limit(n).skip(m). cursor.nextObject(function(err, doc) {}); cursor.each(function(err, doc) {}); cursor.toArray(function(err, docs) {}); cursor.rewind() // reset the cursor to its initial state.
2.insert()
collection.insert(docs, options, [callback]);
Useful options:(*)
safe:true
Should always set if you have a callback.
3.update()
collection.update(criteria, objNew, options, [callback]);
Useful options:(*)
safe:true
Should always set if you have a callback.multi:true
If set, all matching documents are updated, not just the first.upsert:true
Atomically inserts the document if no documents matched.
4.findAndModify()
Useful options:(*)
remove:true
set to a true to remove the object before returningnew:true
set to true if you want to return the modified object rather than the original. Ignored for remove.upsert:true
Atomically inserts the document if no documents matched.
- mongodb 查询要点说明
- NoSQL之【MongoDB】:DML和查询操作说明
- MongoDB设计要点
- 十个 MongoDB 使用要点
- MongoDB 基础要点
- 十个 MongoDB 使用要点
- 十个 MongoDB 使用要点
- MongoDB集群管理要点
- mongodb部分操作要点
- MongoDB 说明
- AIXS2 wsdl2java 要点说明
- mongodb查询
- mongodb 查询
- mongodb查询
- MongoDB查询
- mongodb查询
- mongodb查询
- mongodb查询
- 如何使用arm-linux-androideabi-addr2line
- 百度作站群的小秘密
- 也谈virtual
- 常用的运行命令
- 为什么要将thread对象post到handler中执行呢?
- mongodb 查询要点说明
- js判断年龄是否为数字
- 获取JVM运行状况的几种方式
- 出色的职业经理人共有的一些特征
- 软件工程师的出路在哪里?
- 结构化稀疏----Learning with Structured Sparsity(学习与结构化稀疏)
- Mysql与Sqlite重置 设置AUTO_INCREMENT
- hdu 2076
- 电力系统的颜色