1

Using the Mongodb C Driver, how can I issue shell commands like db.mydb.remove()?

The API seems pretty limited: http://api.mongodb.org/c/current/api/annotated.html

4

1 回答 1

2

To drop collection use mongo_cmd_drop_collection(…), to drop DBs use mongo_cmd_drop_db(…). Most commands are inside mongo.h.

Edit: To perform the requested remove(…) use mongo_remove(…).

于 2013-03-05T08:46:40.210 回答