[CXX-1138] uncought exception: find_and_update => precondition failed: bson Created: 20/Nov/16 Updated: 21/Nov/16 Resolved: 21/Nov/16 |
|
| Status: | Closed |
| Project: | C++ Driver |
| Component/s: | None |
| Affects Version/s: | 3.0.1 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Armin Ball [X] | Assignee: | J Rassi |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
|
Hey there, // codesnippets {{ mongocxx::options::find_one_and_update TheOptions {}; std::cout ... collJobs.find_one_and_update(vieFind,vieUpdate,TheOptions);}} src/bson/bson.c:2193 bson_get_data(): precondition failed: bson // consol: 78 - Find: , } 78 - Update: , 78 - Options.sort: } // Stacktrace: {{__GI_raise (sig=6, sig@entry=6) |
| Comments |
| Comment by J Rassi [ 21/Nov/16 ] |
|
Hi there, thanks for reporting this issue. I've reproduced your issue and can confirm that this ticket is a duplicate of Please note also that {"CServer": {"dateEntry" : 1}} is an invalid sort object. To request an ascending sort on a field with a name of "dateEntry" in a sub-object of a field with a name of "CServer", you should specify a sort object of { "CServer.dateEntry": 1} instead. If you specify an invalid sort object to mongocxx::collection::find_one_and_update(), it should now correctly throw a mongocxx::operation_exception with an appropriate error message. |
| Comment by Armin Ball [X] [ 20/Nov/16 ] |
|
for sorting this works: // commtented the subdocument. bsoncxx::document::value valOrderBy = document{} |