[CXX-894] Return disengaged result optionals for unack'ed write operations Created: 15/Apr/16  Updated: 14/Mar/23  Resolved: 22/Nov/16

Status: Closed
Project: C++ Driver
Component/s: Implementation
Affects Version/s: 3.0.1
Fix Version/s: 3.1.0

Type: Bug Priority: Major - P3
Reporter: Andrew Morrow (Inactive) Assignee: David Golden
Resolution: Done Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on CDRIVER-1194 Wrong reply from unacknowledged bulk ... Closed
Related
Backwards Compatibility: Minor Change

 Description   

Because of CDRIVER-1194, we cannot correctly return disengaged results from the collection interface.



 Comments   
Comment by Githook User [ 14/Mar/23 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}

Message: CXX-2582 revise tutorial (#940)

  • remove outdated comment

CXX-894 is resolved

  • remove libmongoc and libbson include headers

It is not output by pkg-config for libmongocxx and is not necessary for an application

  • fix rendering of invalid JSON

The invalid JSON values are rendered highlighted in black.

  • add initial tutorial
  • rename `coll` to `collection`
  • use `collection`, not `restaurants`
  • use `string_view`, not `string`

Fixes `error: no member named 'to_string' in 'std::string_view'`

  • use `view`, not `doc`
  • use `auto`
  • distinguish result variables
  • show example of getting insert ids

This is requested in the ticket.

  • add scopes and comments
  • use inline document
  • replace stream builder with basic builder

Use of the stream builder is documented as discouraged.
The basic builder syntax is more succinct.

  • make less documents

To shorten the output

  • drop collection to clean up
  • rename `view` to `doc_view`
  • add assertions on unused variables

To fix `-Wunused-variable` warnings

  • assert writes return results

This is the default behavior unless overridden with an unacknowledged write concern.

  • update "versions" array to reflect supported versions

C++ driver 3.7.0 depends on C driver 1.22.1.
C driver 1.22.1 supports MongoDB versions 3.6+.
The docs compatibility table here is incorrect: https://www.mongodb.com/docs/drivers/cxx/#mongodb-compatibility

  • fix assert
  • use only three documents in tutorial

To further simplify example.

  • use assert instead of printing
  • add example of printing all documents
  • remove TODO comment
  • remove whitespace
  • note requirement of get_utf8 in C++ driver < 3.7.0
  • apply changes to tutorial.md
  • fix assert define check
  • move redefinition of `assert` macro

Release builds may undefine the assert macro and result
in -Wunused-variable warnings.

  • Update docs/content/mongocxx-v3/tutorial.md

Co-authored-by: Roberto C. Sánchez <roberto@connexer.com>

---------

Co-authored-by: Roberto C. Sánchez <roberto@connexer.com>
Branch: releases/stable
https://github.com/mongodb/mongo-cxx-driver/commit/a94ee660b66a511528a927c8ed8da5d111d5fc9d

Comment by Githook User [ 13/Mar/23 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}

Message: CXX-2582 revise tutorial (#940)

  • remove outdated comment

CXX-894 is resolved

  • remove libmongoc and libbson include headers

It is not output by pkg-config for libmongocxx and is not necessary for an application

  • fix rendering of invalid JSON

The invalid JSON values are rendered highlighted in black.

  • add initial tutorial
  • rename `coll` to `collection`
  • use `collection`, not `restaurants`
  • use `string_view`, not `string`

Fixes `error: no member named 'to_string' in 'std::string_view'`

  • use `view`, not `doc`
  • use `auto`
  • distinguish result variables
  • show example of getting insert ids

This is requested in the ticket.

  • add scopes and comments
  • use inline document
  • replace stream builder with basic builder

Use of the stream builder is documented as discouraged.
The basic builder syntax is more succinct.

  • make less documents

To shorten the output

  • drop collection to clean up
  • rename `view` to `doc_view`
  • add assertions on unused variables

To fix `-Wunused-variable` warnings

  • assert writes return results

This is the default behavior unless overridden with an unacknowledged write concern.

  • update "versions" array to reflect supported versions

C++ driver 3.7.0 depends on C driver 1.22.1.
C driver 1.22.1 supports MongoDB versions 3.6+.
The docs compatibility table here is incorrect: https://www.mongodb.com/docs/drivers/cxx/#mongodb-compatibility

  • fix assert
  • use only three documents in tutorial

To further simplify example.

  • use assert instead of printing
  • add example of printing all documents
  • remove TODO comment
  • remove whitespace
  • note requirement of get_utf8 in C++ driver < 3.7.0
  • apply changes to tutorial.md
  • fix assert define check
  • move redefinition of `assert` macro

Release builds may undefine the assert macro and result
in -Wunused-variable warnings.

  • Update docs/content/mongocxx-v3/tutorial.md

Co-authored-by: Roberto C. Sánchez <roberto@connexer.com>

---------

Co-authored-by: Roberto C. Sánchez <roberto@connexer.com>
Branch: releases/v3.7
https://github.com/mongodb/mongo-cxx-driver/commit/a94ee660b66a511528a927c8ed8da5d111d5fc9d

Comment by Githook User [ 13/Mar/23 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}

Message: CXX-2582 revise tutorial (#940)

  • remove outdated comment

CXX-894 is resolved

  • remove libmongoc and libbson include headers

It is not output by pkg-config for libmongocxx and is not necessary for an application

  • fix rendering of invalid JSON

The invalid JSON values are rendered highlighted in black.

  • add initial tutorial
  • rename `coll` to `collection`
  • use `collection`, not `restaurants`
  • use `string_view`, not `string`

Fixes `error: no member named 'to_string' in 'std::string_view'`

  • use `view`, not `doc`
  • use `auto`
  • distinguish result variables
  • show example of getting insert ids

This is requested in the ticket.

  • add scopes and comments
  • use inline document
  • replace stream builder with basic builder

Use of the stream builder is documented as discouraged.
The basic builder syntax is more succinct.

  • make less documents

To shorten the output

  • drop collection to clean up
  • rename `view` to `doc_view`
  • add assertions on unused variables

To fix `-Wunused-variable` warnings

  • assert writes return results

This is the default behavior unless overridden with an unacknowledged write concern.

  • update "versions" array to reflect supported versions

C++ driver 3.7.0 depends on C driver 1.22.1.
C driver 1.22.1 supports MongoDB versions 3.6+.
The docs compatibility table here is incorrect: https://www.mongodb.com/docs/drivers/cxx/#mongodb-compatibility

  • fix assert
  • use only three documents in tutorial

To further simplify example.

  • use assert instead of printing
  • add example of printing all documents
  • remove TODO comment
  • remove whitespace
  • note requirement of get_utf8 in C++ driver < 3.7.0
  • apply changes to tutorial.md
  • fix assert define check
  • move redefinition of `assert` macro

Release builds may undefine the assert macro and result
in -Wunused-variable warnings.

  • Update docs/content/mongocxx-v3/tutorial.md

Co-authored-by: Roberto C. Sánchez <roberto@connexer.com>

---------

Co-authored-by: Roberto C. Sánchez <roberto@connexer.com>
Branch: master
https://github.com/mongodb/mongo-cxx-driver/commit/6af37f81dfc64d1bcd33b993515a7c50e83654bb

Comment by Githook User [ 29/Nov/16 ]

Author:

{u'username': u'xdg', u'name': u'David Golden', u'email': u'xdg@xdg.me'}

Message: CXX-894 Return disengaged result optional for w:0 writes
Branch: master
https://github.com/mongodb/mongo-cxx-driver/commit/b2df02d26d3f904d65aed1a2a182a9b6bcf5bb51

Comment by Githook User [ 22/Nov/16 ]

Author:

{u'username': u'xdg', u'name': u'David Golden', u'email': u'xdg@xdg.me'}

Message: CXX-894 Return disengaged result optional for w:0 writes
Branch: 3.1-dev
https://github.com/mongodb/mongo-cxx-driver/commit/b2df02d26d3f904d65aed1a2a182a9b6bcf5bb51

Comment by David Golden [ 18/Nov/16 ]

Marking "minor change": while the signature hasn't changed, unacked writes that would have returned an engaged optional won't. It seems unlikely that people were checking for it or doing anything with the result, but I think we should flag it as a minor change anyway.

Comment by David Golden [ 17/Nov/16 ]

https://mongodbcr.appspot.com/108190002/

Comment by Andrew Morrow (Inactive) [ 06/Jun/16 ]

Please see https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/mongodb-user/ws0m7sC_MF4/3VaU4O98DwAJ for motivation.

Generated at Wed Feb 07 22:00:42 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.