Details
-
New Feature
-
Resolution: Done
-
Major - P3
-
None
-
None
Description
(Original title: "find/cursor documentation doesn't warn about client lifetime")
From https://groups.google.com/forum/#!topic/mongodb-user/girvbR21AzM:
auto c = pool->acquire()->database()[collection].find({});// loop cpool->acquire() returns an unique_ptr, and cursor object c rely on this unique_ptr, before c destroy, unique_ptr need stay.
This is dangerous, however user may never find this bug until they release into production env.
Maybe add an assert to check this, let it crash early.
Attachments
Issue Links
- depends on
-
CDRIVER-1980 Incorrect lifecycle documentation needs review
-
- Closed
-