How to use the cursor in the new C++ Mongo Driver
<p>I am using the new C++ driver to access MongoDB from my C++ program.
Through the tutorial I am able to fetch an entire collection from the DB.
I am also able to specify filters so I only get a few.</p>

<p>But once I get the collection data into the program, there is only a single example available for inspecting the data:</p>

<pre><code>for (auto&amp;&amp; doc : cursor) {
    std::cout &lt;&lt; bsoncxx::to_json(doc) &lt;&lt; std::endl;
}
</code></pre>

<p>I would like to know how to get the count of the collection
I would also like to know how to get number "i" in the return data, i.e.,:</p>

<p>cursor[i] or similar... which of course doesn't work.</p>