[CDRIVER-1886] Expose mongoc_cursor_t 'sent' field Created: 26/Oct/16  Updated: 12/Nov/16  Resolved: 12/Nov/16

Status: Closed
Project: C Driver
Component/s: libmongoc
Affects Version/s: None
Fix Version/s: 1.5.0

Type: New Feature Priority: Major - P3
Reporter: David Golden Assignee: A. Jesse Jiryu Davis
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to CXX-1001 mongocxx::cursor.begin() increments t... Closed
related to CXX-1100 Having more than one iterator per cur... Closed
is related to CDRIVER-1911 Query and command cursor inconsistencies Closed

 Description   

I'd like to see mongoc_cursor_t expose the sent field, perhaps via a new function like this:

bool
mongoc_cursor_is_sent ( const mongoc_cursor_t *cursor )
{
   BSON_ASSERT (cursor);
 
   return !!cursor->sent;
}

This would allow HLL wrappers to determine whether the query has been sent or not, which avoids wrappers having to track this identical information on their end (based on whether mongoc_cursor_next has yet been called). See CXX-1001 and CXX-1100 for context.

I have no objection to alternate names along the lines of mongoc_cursor_query_sent, mongoc_cursor_has_executed, etc. if mongoc_cursor_is_sent is objectionable.



 Comments   
Comment by A. Jesse Jiryu Davis [ 12/Nov/16 ]

See CDRIVER-1911 - we decided the C++ driver is better off managing this state itself.

Comment by Githook User [ 12/Nov/16 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: Revert "CDRIVER-1886 add mongoc_cursor_sent"

This reverts commit 594764260d21afb04e2a4b02a7511818c54d0513.
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/d23e71f533748106486dbe8831e8ad7b33ecb820

Comment by Githook User [ 26/Oct/16 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: CDRIVER-1886 add mongoc_cursor_sent
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/594764260d21afb04e2a4b02a7511818c54d0513

Generated at Wed Feb 07 21:13:31 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.