[CDRIVER-1092] mongoc_cursor_new_from_command_reply Created: 09/Feb/16  Updated: 10/Aug/16  Resolved: 22/Feb/16

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

Type: New Feature Priority: Major - P3
Reporter: Hannes Magnusson Assignee: A. Jesse Jiryu Davis
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by PHPC-602 Create command cursors with mongoc_cu... Closed
Related
is related to CDRIVER-1192 Leak in _mongoc_cursor_cursorid_init_... Closed
Epic Link: Public API for PHP drivers

 Description   

When a user executes a command using mongoc_client_command() that returns a "cursor document", such as executing "aggregate" and using the "cursor" option, we need a way for the user to create an actual mongoc_cursor_t from this document.



 Comments   
Comment by Githook User [ 06/Jul/16 ]

Author:

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

Message: CDRIVER-1092 leak in command_simple_with_server_id

Leak found in unreleased code.
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/d974e86724137c8ddc9a1fd1572d60290495e621

Comment by Githook User [ 26/Feb/16 ]

Author:

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

Message: CDRIVER-1092 leak in client_command_simple
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/97a5e10f8d5cdea98f467d72d48981ae3acb5cc4

Comment by Githook User [ 23/Feb/16 ]

Author:

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

Message: CDRIVER-1092 rename command_simple_with_hint.page
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/09428f274dd70d68e44716570859b2089ef3b1ab

Comment by Hannes Magnusson [ 23/Feb/16 ]

derick Its a new function that was added to replace https://github.com/mongodb/mongo-php-driver/blob/master/php_phongo.c#L654-L718 with

mongoc_client_command_simple_with_hint (...);
cursor = mongoc_cursor_new_from_command_reply (...);

Comment by Derick Rethans [ 23/Feb/16 ]

Neither the HHVM or PHP drivers use the mongoc_cursor_new_from_command_document() function, so which API call does this actually replace?

Comment by Githook User [ 23/Feb/16 ]

Author:

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

Message: CDRIVER-1092 finish updating symbol files
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/cc3792b811955c8710c4212475bb7b46d3dacb0e

Comment by A. Jesse Jiryu Davis [ 22/Feb/16 ]

driver-php, check out how this is intended to be used for "aggregate", etc., cursors:

https://github.com/mongodb/mongo-c-driver/blob/f3666/tests/test-mongoc-cursor.c#L636

To avoid extra copying of the reply, you allocate a bson_t with bson_new, store the result of mongoc_client_command_simple_with_hint there, then donate the bson_t to mongoc_cursor_new_from_command_reply, which now owns the reply and is responsible for freeing it.

Comment by Githook User [ 22/Feb/16 ]

Author:

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

Message: CDRIVER-1092 mongoc_cursor_new_from_command_reply
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/f3666b35bf06b77e10b201a5a983971c6b9fda52

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