Hello,
When you call the next() function on a cursor, in the 26compat driver, it gives you back a BSONObj by value, however its lifetime is driven by some internal mechanism inside the cursor object.
We have been bitten by this and quickly fixed it by explicitely calling the copy() method if our BSONObj outlives the next call to next().
We do understand that from a performance point of view, and given that it was directly in the server before, that this behavior of no-copy is beneficial.
However, in a brand new driver (such as the one you seem to be creating on master branch) it would be very nice to have better visibility on the lifetime on the object just by looking at what return the functions.
We think this is an important API design for a driver, especially now that C++11 has unique_ptr/shared_ptr or w/e type of lifetime mechanism you would need.