Accessing data via the instance management example

I’m attempting to use the Instance Management Example with the mongocxx driver in an application. I’m having trouble getting the syntax to actually access a database collection. In the do_work() method, how would one use the local connection var to get data from a collection?

I’ve tried variations of

mongocxx::client& client = *connection;    
auto coll = (*client)["infoscan"]["points"];

but can’t seem to come up with the right approach.

It turned out my syntax was correct, I just needed
#include <mongocxx/client.hpp>

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.