您的位置:首页 > 博客中心 > 数据库 >

MongoDB C driver API continues

时间:2022-03-14 00:16

开篇前

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

gxlsystem.com,布布扣

runing Example:

gxlsystem.com,布布扣

2,update document

gxlsystem.com,布布扣

gxlsystem.com,布布扣

3,finding a document

gxlsystem.com,布布扣

gxlsystem.com,布布扣

跟进specifying a query

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

gxlsystem.com,布布扣

gxlsystem.com,布布扣

db.users.stats()

gxlsystem.com,布布扣

gxlsystem.com,布布扣

4,Execing a command

gxlsystem.com,布布扣

gxlsystem.com,布布扣

热门排行

今日推荐

热门手游