[CXX-866] It will raise runtime error at finish of program when using mongocxx::options::find.limit() Created: 15/Mar/16 Updated: 11/Sep/19 Resolved: 23/Mar/16 |
|
| Status: | Closed |
| Project: | C++ Driver |
| Component/s: | API |
| Affects Version/s: | 3.0.0 |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | zy1989 [X] | Assignee: | Unassigned |
| Resolution: | Incomplete | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Ubuntu15.4 Clang3.6.0 |
||
| Description |
|
mongocxx::collection collection = conn["wechat"]["article"]; condition << "subscribeRobot" << open_document << "$exists" << 1 << close_document; mongocxx::cursor cur = collection.find(condition.view(), opts); |
| Comments |
| Comment by zy1989 [X] [ 23/Mar/16 ] |
|
Sorry for relying late, Matt. This error doesn't cause by code pasted here. |
| Comment by Matt Cotter [ 23/Mar/16 ] |
|
Hello! It's been a while with no news; I'm closing this for now. Thanks! |
| Comment by Matt Cotter [ 16/Mar/16 ] |
|
New update! The official word is that {mongoc_cursor_next}is supposed to work as we expect. LeoZhao - can you consistently reproduce this? If so, would you mind posting a dump of the data that you use to reproduce this? Thanks again! |
| Comment by Matt Cotter [ 16/Mar/16 ] |
|
acm - I'm still looking into how this can happen, but the advice from bjori is reflected in this PR. LeoZhao - can you try the branch in the PR and see if it fixes your issue? Thanks again for reporting this |
| Comment by Andrew Morrow (Inactive) [ 16/Mar/16 ] |
|
Under what circumstances does mongoc_collection_find fail to return a cursor? I think that should inform our decision. If the case where it does not return a cursor really represents an error (one for which we can ask the underlying C driver what went wrong), I would lean towards an exception. |
| Comment by Matt Cotter [ 15/Mar/16 ] |
|
Hi LeoZhao,
It looks like libmongoc's mongoc_collection_find can return a failed cursor, but we don't check for that in mongocxx collection find, nor do we offer a way to test this in the cursor class itself. acm - I'm thinking that we should do one of
thoughts? |
| Comment by zy1989 [X] [ 15/Mar/16 ] |
|
Following error will be throwed in the print of last document. |