- 浏览: 259532 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (263)
- mysql (5)
- boost (6)
- 工具 (10)
- IT生活 (7)
- 多线程 (3)
- Ruby (15)
- php (2)
- MongoDB (39)
- 移动互联网 (2)
- 测试 (8)
- c++ (28)
- 书 (1)
- 网站 (3)
- 网络编程 (14)
- 开源软件 (1)
- 分布式计算 (1)
- 得得得 (1)
- php,wordpress (1)
- error (5)
- 编译 (2)
- 学习 (1)
- 杀毒软件 (1)
- dd (0)
- linux (21)
- 数据库 (1)
- STL (1)
- c++/c (5)
- 软件设计 (1)
- 操作系统 (4)
- 库 (2)
- win32 (1)
- s (0)
- openssl (1)
- perl (2)
- debug (1)
- windows (4)
- python (12)
- windows 防火墙 (1)
- vs (1)
- vim (2)
- vc (1)
- 浏览器插件的危害 (1)
- curl (0)
- 判断手机号码合法性的库 (0)
- 地址备注 (0)
- 安装 File::Slurp (1)
- cenos (2)
- shell (1)
- linunx (1)
- internet (1)
- software (1)
- widows (1)
- linux io (1)
- nginx (2)
- 算法 (2)
- google (1)
- protobuf (2)
- tengine (1)
- tools (1)
- lua (2)
- liunx (1)
- vcard (1)
- lua-iconv (1)
- 网络 (2)
- teat (0)
- ldconfig linux (0)
- awk (0)
- grep (0)
- windws (2)
- linux 命令 (1)
- tcp dump (1)
- vmware (1)
- question2answer (2)
- mongdb (1)
- 正则 (1)
- OCR (2)
- Windows Server (1)
最新评论
BSONArray
BSONArrayBuilder
BSON Arrays in C++
http://www.mongodb.org/display/DOCS/Updating#Updating-PushingaUniqueValue
http://docs.mongodb.org/ecosystem/drivers/cpp-bson-array-examples/
http://docs.mongodb.org/manual/reference/operator/or/
BSONArrayBuilder
BSON Arrays in C++
http://www.mongodb.org/display/DOCS/Updating#Updating-PushingaUniqueValue
> db.mongodb.insert({"dbName": "343", hostPort: ["127.0.0.1:1001", "127.0.1.2:4000"]}) > db.mongodb.find() { "_id" : ObjectId("4f97b77afdc44ff960010ce2"), "dbName" : "343", "hostPort" : [ "192.168.0.191:30000" ] } { "_id" : ObjectId("4f97c3f3fdc44ff960010ce5"), "dbName" : "343", "hostPort" : [ "127.0.0.1:1001", "127.0.1.2:400 0" ] } >
string mongodbCollection = "test.mongodb"; auto_ptr<mongo::DBClientCursor> cursor = c->query( mongodbCollection , mongo::BSONObj() ); int count = 0; while ( cursor->more() ) { count++; mongo::BSONObj obj = cursor->next(); const char *pDbName = obj.getStringField("dbName"); mongo::BSONElement hostPortElement = obj.getField("hostPort"); if (!hostPortElement.eoo() &&hostPortElement.type() == mongo::Array ) { vector<mongo::BSONElement> hostPorts = hostPortElement.Array(); for (vector<mongo::BSONElement>::iterator it = hostPorts.begin(); it != hostPorts.end(); ++it) { string temp; it->Val(temp); cout << temp.c_str() << endl; } } }
// examples using namespace mongo; using namespace bson; bo an_obj; /** transform a BSON array into a vector of BSONElements. we match array # positions with their vector position, and ignore any fields with non-numeric field names. */ vector<be> a = an_obj["x"].Array(); be array = an_obj["x"]; assert( array.isABSONObj() ); assert( array.type() == Array ); // Use BSON_ARRAY macro like BSON macro, but without keys BSONArray arr = BSON_ARRAY( "hello" << 1 << BSON( "foo" << BSON_ARRAY( "bar" << "baz" << "qux" ) ) ); // BSONArrayBuilder can be used to build arrays without the macro BSONArrayBuilder b; b.append(1).append(2).arr(); /** add all elements of the object to the specified vector */ bo myarray = an_obj["x"].Obj(); vector<be> v; myarray.elems(v); list<be> L; myarray.elems(L) /** add all values of the object to the specified collection. If type mismatches, exception. template <class T> void Vals(vector<T> &) const; template <class T> void Vals(list<T> &) const; */ /** add all values of the object to the specified collection. If type mismatches, skip. template <class T> void vals(vector<T> &) const; template <class T> void vals(list<T> &) const; */
http://docs.mongodb.org/ecosystem/drivers/cpp-bson-array-examples/
http://docs.mongodb.org/manual/reference/operator/or/
发表评论
-
mongodb 从3.0 升级到3.2
2016-06-15 19:27 1406下载mongodb: curl "https://f ... -
MongoDB 日志切换
2016-06-13 17:47 780MongoDB默认情况下不会自动的切换轮转日志的,这将会导致日 ... -
mongodb c++ driver 从2.4.6 升级到3.0.1 注意点 (windows版本)
2015-09-15 17:58 6371. 使用mongodbclient的静态库需要定义下面的值 ... -
check_mongodb nagios
2015-08-17 17:22 0nagios check_mongodb插件监控mongodb ... -
Mongodb profiling
2015-08-06 10:14 369Mongodb profiling是Mngodb提供的类似于m ... -
linux mongdb 备份操作笔记
2015-07-22 09:21 537目的:添加一个延迟1小时的sencodary作为冷备数据库 ... -
mongodb 操作失失误救策略
2015-07-14 20:47 391杀掉某个正在处理的操作: db.currentOp() db ... -
mongodb oplog
2015-06-30 10:53 483mongodb oplog的使用 所在位置: Master/ ... -
mongodb 升级的问题导致添加帐号出现问题
2015-06-05 11:47 904mongodb 原有数据库版本:2.2.2 更新到数据库版本 ... -
libmongodbclient 2.6.6
2015-02-25 11:43 444mongodb c++ driver 2.6之后的版本不能从m ... -
mongodb 搜索结果保存到文件中
2013-07-22 16:44 1903第一种方式: mongo localhost:11111/te ... -
getLastError mongodb
2013-04-03 10:32 0一、简介 很多人抱怨mongodb是内存数据库,也没有事务,会 ... -
getLastError mongodb
2013-03-30 18:24 880http://docs.mongodb.org/manual/ ... -
[转]十个 MongoDB 使用要点
2013-03-20 10:19 790从 [url = "http://space.i ... -
利用mongodb c++ driver来编译
2012-12-04 15:12 0编译库时错误: 引用 E:\code_64\v2.2.2\m ... -
scons 64 mongodb
2012-08-01 19:52 948编译64位mongodb spin_lock.cpp cl ... -
scons 编译 mongodb client lib
2012-07-31 20:09 1178Use scons to build MongoDB and ... -
MongoDB 客户端 MongoVue
2012-05-14 11:13 919今天在同事那里看到了 ... -
mongodb 2.0.0 replica set + authentication bug
2012-04-26 13:56 899mongodb 2.0.0 replica set + aut ... -
(转) RockMongo查询操作用法总结
2012-04-11 20:40 27411.简单查询 //xid=560870 and type=vi ...
相关推荐
windows 下 MongoDB C++ 64位驱动,debug库文件,目前最新MongoDB C++ Driver 3.4.x版。
MongoDB C++ Driver 3.4.x 版,是目前最新版本。需要和MongoDBC驱动一起使用。
赠送jar包:mongodb-driver-core-4.2.3.jar; 赠送原API文档:mongodb-driver-core-4.2.3-javadoc.jar; 赠送源代码:mongodb-driver-core-4.2.3-sources.jar; 赠送Maven依赖信息文件:mongodb-driver-core-4.2.3....
mongodb c#驱动 最新驱动mongodb.driver.dll 版本2.12.0-beta1,包内有MongoDB.Bson.dll 、mongodb.driver.core.dll 等文件
赠送jar包:mongodb-driver-sync-4.2.3.jar; 赠送原API文档:mongodb-driver-sync-4.2.3-javadoc.jar; 赠送源代码:mongodb-driver-sync-4.2.3-sources.jar; 赠送Maven依赖信息文件:mongodb-driver-sync-4.2.3....
java和mongodb连接,需要mongodb-driver,您还必须下载其依赖项: bson和 mongodb-driver-core》》3个包: mongodb-driver-3.8.2.jar; bson-3.8.2.jar; mongodb-driver-core-3.8.2.jar
赠送jar包:mongodb-driver-sync-4.2.3.jar; 赠送原API文档:mongodb-driver-sync-4.2.3-javadoc.jar; 赠送源代码:mongodb-driver-sync-4.2.3-sources.jar; 赠送Maven依赖信息文件:mongodb-driver-sync-4.2.3....
MongoDB Java Driver 简单操作
mongodb-driver-core-3.5.0.jar,链接驱动
mongodb-driver-core-3.4.3,mongodb java开发常用组件。
mongodb-driver-3.4.3,mongodb java开发中常用组件。
mongoDB java driver api mongoDB java 驱动 所有类的api
赠送jar包:mongodb-driver-core-4.2.3.jar; 赠送原API文档:mongodb-driver-core-4.2.3-javadoc.jar; 赠送源代码:mongodb-driver-core-4.2.3-sources.jar; 赠送Maven依赖信息文件:mongodb-driver-core-4.2.3....
MongoDB针对C++驱动的安装
mongodb-driver-3.4.0-rc1.jar mongodb-driver-3.4.0-rc1.jar mongodb-driver-3.4.0-rc1.jar mongodb-driver-3.4.0-rc1.jar
mongodb-driver-core 4.3.3版本
由C++语言编写。旨在为WEB应用提供可扩展的高性能数据存储解决方案。 MongoDB是一个介于关系数据库和非关系数据库之间的产品,是非关系数据库当中功能最丰富,最像关系数据库的。他支持的数据结构非常松散,是类似...
mongodb-driver-3.0.3.jar的java连接驱动
1. 设计并开发高效的C++对象池算法,时间复杂度为 O(1) 在整个重构框架中,对象池是负责管理内存的底层基本模块 2. 利用命令模式的思想开发 Redis 子模块 抽象出方便高效的接口提供给上层程序员使用 3. 利用组合...
MongoDB C++驱动编译教程,采用scons完成MongoDB C++驱动的编译,包括 boost库下载地址,MongoDB C++t驱动下载地址,包括Python 2.7.16版本 32位 X86安装包,以及驱动编译的具体教程,及编译过程中的几个示例。...