[mongocxx] dropIndexes command

27 views
Skip to first unread message

minmax

unread,
May 25, 2017, 7:32:25 AM5/25/17
to mongodb-user
Hi,

Does mongocxx-3.1.x provide a way to drop an index from a collection?
The legacy C++ driver used to have DBClientWithCommands::dropIndex, but I couldn't find a way to do that with the recent mongocxx.

Thanks

Sam Rossi

unread,
May 25, 2017, 12:09:23 PM5/25/17
to mongodb-user
Hi minmax! To drop indexes using mongocxx, you can use the method database::run_command. The format of the document to pass in is described here.

minmax

unread,
May 26, 2017, 8:39:15 AM5/26/17
to mongodb-user
Thank you for the help, Sam

Sam Rossi

unread,
May 26, 2017, 12:54:47 PM5/26/17
to mongodb-user
You're welcome! Feel free to ask again if you have any other questions
Reply all
Reply to author
Forward
0 new messages