MongoDB C driver API continues

开篇前

<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:

MongoDB C driver API continues

runing Example:

MongoDB C driver API continues

2,update document

MongoDB C driver API continues

MongoDB C driver API continues

3,finding a document

MongoDB C driver API continues

MongoDB C driver API continues

跟进specifying a query

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

MongoDB C driver API continues

MongoDB C driver API continues

db.users.stats()

MongoDB C driver API continues

MongoDB C driver API continues

4,Execing a command

MongoDB C driver API continues

MongoDB C driver API continues

MongoDB C driver API continues

上一篇:Linux下Mongodb安装和启动配置


下一篇:java 连接jdbc部分