设为首页 加入收藏

TOP

Mongodb操作详解(一)(三)
2014-11-24 08:24:04 来源: 作者: 【 】 浏览:7
Tags:Mongodb 操作 详解
ta and indexes
db.foo.update(query, object[, upsert_bool, multi_bool])
db.foo.validate( ) - SLOW
db.foo.getShardVersion() - only for use with sharding
db.foo.getShardDistribution() - prints statistics about data distributio
n in the cluster
>
//想要了解一个函数,可以不写括号()运行,即可打印出该函数的源代码
> db.foo.update
function (query, obj, upsert, multi) {
assert(query, "need a query");
assert(obj, "need an object");
var firstKey = null;
for (var k in obj) {
firstKey = k;
break;
} www.2cto.com
if (firstKey != null && firstKey[0] == "$") {
this._validateObject(obj);
} else {
this._validateForStorage(obj);
}
this._mongo.update(this._fullName, query, obj, upsert true : false, multi
true : false);
}
//当集合(表)和db原有的属性相同时
//如db.version()为得到版本的函数
//当你创建集合(表)时,创建了同名的时
//那运行db.version得到的时version()函数源代码
//办法是运行db.getCollection('version')
首页 上一页 1 2 3 下一页 尾页 3/3/3
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇LevelDB数据库使用 下一篇SQL操作汇总

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·Redis压力测试实战 - (2025-12-27 09:20:24)
·高并发一上来,微服 (2025-12-27 09:20:21)
·Redis 高可用架构深 (2025-12-27 09:20:18)
·Linux 系统监控 的完 (2025-12-27 08:52:29)
·一口气总结,25 个 L (2025-12-27 08:52:27)