[CDRIVER-4173] mongoc_collection_find_and_modify documentation is not fully correct Created: 04/Oct/21 Updated: 28/Oct/23 Resolved: 12/May/23 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | docs |
| Affects Version/s: | None |
| Fix Version/s: | 1.24.0 |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Fermín Galán | Assignee: | Kevin Albertson |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | documentation, neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Quarter: | FY24Q2 |
| Description |
|
From driver documentation for find_and_modify operation at http://mongoc.org/libmongoc/current/mongoc_collection_find_and_modify.html?highlight=find_and_modify: "Returns either the document before or after modification based on the _new parameter." However, as far as I checked what is returned (in the reply parameter) is not the document, but a kind of "wraper" with the document:
Not this is not the behaviour if we use findAndModify() in the MongoShell. Example:
I understand the driver documentation should explain this (thus, this issue is a kind of "documentation bug"). |
| Comments |
| Comment by Githook User [ 12/May/23 ] | ||||||||||||||||
|
Author: {'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}Message:
The minimum supported server version of the C driver is 3.6. Documentation can assume user is using 3.6 or newer.
Co-authored-by: vector-of-bool <vectorofbool@gmail.com>
This reverts commit 591ade57d4bd2f78c8d98d9e3e7729ae153f9ea2.
--------- Co-authored-by: vector-of-bool <vectorofbool@gmail.com> | ||||||||||||||||
| Comment by Fermín Galán [ 10/May/23 ] | ||||||||||||||||
|
Done! | ||||||||||||||||
| Comment by Kevin Albertson [ 09/May/23 ] | ||||||||||||||||
|
fermin.galanmarquez@telefonica.com that would be much appreciated. Here is the PR: https://github.com/mongodb/mongo-c-driver/pull/1263 | ||||||||||||||||
| Comment by Fermín Galán [ 09/May/23 ] | ||||||||||||||||
|
I have realized that the ticket has progressed to "code review" status. Could you provide the link to the pull request with the modifications? I could have a look if you want an provide user-based feedback | ||||||||||||||||
| Comment by Kevin Albertson [ 04/Oct/21 ] | ||||||||||||||||
|
Hi fermin.galanmarquez@telefonica.com, thank you for the report! I agree that the driver documentation is incorrect. The reply document is the raw server reply from the findAndModify command. To see that in the MongoDB shell
|