码迷,mamicode.com
首页 > 数据库 > 详细

MongoDB C driver API continues

时间:2014-09-25 14:19:09      阅读:323      评论:0      收藏:0      [点我收藏+]

标签:des   http   io   os   ar   for   div   sp   art   

开篇前

<1,mongoc_init() func>

mongoc_init()

Synopsis

void
mongoc_init (void);

Description

This function should be called at the beginning of every program using the MongoDB C driver. It is responsible for initializing global state such as process counters, SSL, and threading primatives.

When your process has completed, you should also call mongoc_clearup()

<2,mongoc_cleanup() func>

mongoc_cleanup()

Synopsis

void
mongoc_cleanup (void);

Description

This function is responsible for cleaning up after use of the MongoDB C driver. It will release any lingering allocated memory which can be useful when running under valgrind.

1,insert document

part statement codeExample:

bubuko.com,布布扣

runing Example:

bubuko.com,布布扣

2,update document

bubuko.com,布布扣

bubuko.com,布布扣

3,finding a document

bubuko.com,布布扣

bubuko.com,布布扣

跟进specifying a query

find a specifyc document maching {"Hello":"world"}

bubuko.com,布布扣

bubuko.com,布布扣

db.users.stats()

bubuko.com,布布扣

bubuko.com,布布扣

4,Execing a command

bubuko.com,布布扣

bubuko.com,布布扣

MongoDB C driver API continues

标签:des   http   io   os   ar   for   div   sp   art   

原文地址:http://www.cnblogs.com/ruiy/p/MongoCAPIDriver.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!