[CXX-1053] Add getters to options::create_collection/options::create_view/validation_criteria classes, make setters support chaining, deprecate to_document() methods Created: 29/Sep/16  Updated: 13/Dec/16  Resolved: 28/Nov/16

Status: Closed
Project: C++ Driver
Component/s: API
Affects Version/s: None
Fix Version/s: 3.1.0

Type: New Feature Priority: Major - P3
Reporter: J Rassi Assignee: J Rassi
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to CXX-999 Support read-only views Closed
related to CXX-1058 Deprecate database::modify_collection() Closed
Backwards Compatibility: Minor Change

 Description   

The options::create_collection and options::create_view classes vary from the other options classes in that they embed knowledge of the command request formats for their command (the "create" command).

We should add getters to these classes, and deprecate their to_document() methods. Once this is done, these classes will be more struct-like and thus more consistent with the other options classes. Knowledge of the command format for "create" could then be moved to the collection class, where it belongs.

Similar work should be completed for the validation_criteria class. The setters for the validation_criteria class should also support method chaining, for consistency with similar struct-like classes.

The deprecations added in this ticket will be documentation-only deprecations. The work to add compiler warnings for the newly-deprecated methods will be completed under CXX-1056.



 Comments   
Comment by Githook User [ 29/Nov/16 ]

Author:

{u'username': u'jrassi', u'name': u'J. Rassi', u'email': u'rassi@10gen.com'}

Message: CXX-1053 Fix disengaged optional deref in 65e0c218
Branch: master
https://github.com/mongodb/mongo-cxx-driver/commit/22f60342c8599b92450417592177917e94cabbcf

Comment by Githook User [ 29/Nov/16 ]

Author:

{u'username': u'jrassi', u'name': u'J. Rassi', u'email': u'rassi@10gen.com'}

Message: CXX-1053 Avoid passing stdx::optional to Catch comparison expression

Catch attempts to convert comparison operands to strings with
operator<<() (in case of an assertion failure), and this causes a
compile error in some configurations when the operand is of type
boost::optional<T>, since we don't currently include optional_io.hpp.
Branch: master
https://github.com/mongodb/mongo-cxx-driver/commit/65e0c218cb97941945ced532e23453e6e8c462b9

Comment by Githook User [ 29/Nov/16 ]

Author:

{u'username': u'jrassi', u'name': u'J. Rassi', u'email': u'rassi@10gen.com'}

Message: CXX-1053 database::create_collection(): call options methods in order
Branch: master
https://github.com/mongodb/mongo-cxx-driver/commit/06dc612734e3c9a2fadffd82656f3bd1e6e3f724

Comment by Githook User [ 29/Nov/16 ]

Author:

{u'username': u'jrassi', u'name': u'J. Rassi', u'email': u'rassi@10gen.com'}

Message: CXX-1053 Alphabetize options::create_collection members/methods
Branch: master
https://github.com/mongodb/mongo-cxx-driver/commit/b3d9938db86f3c1dc335810918f488c7c87438b5

Comment by Githook User [ 29/Nov/16 ]

Author:

{u'username': u'jrassi', u'name': u'J. Rassi', u'email': u'rassi@10gen.com'}

Message: CXX-1053 Add options::create_collection getters, deprec. to_document()
Branch: master
https://github.com/mongodb/mongo-cxx-driver/commit/52172cb2d93a5fc928ae359caeff5ff897bffa27

Comment by Githook User [ 29/Nov/16 ]

Author:

{u'username': u'jrassi', u'name': u'J. Rassi', u'email': u'rassi@10gen.com'}

Message: CXX-1053 Add options::create_view getters, deprecate to_document()
Branch: master
https://github.com/mongodb/mongo-cxx-driver/commit/f6c64adb6a34356ea2fdafd7e5d38f8e0fc157a4

Comment by Githook User [ 29/Nov/16 ]

Author:

{u'username': u'jrassi', u'name': u'J. Rassi', u'email': u'rassi@10gen.com'}

Message: CXX-1053 Add validation_criteria getters, deprecate to_document()
Branch: master
https://github.com/mongodb/mongo-cxx-driver/commit/567f71d6e91928efa62e34d5af3e11d96aa328c8

Comment by Githook User [ 29/Nov/16 ]

Author:

{u'username': u'jrassi', u'name': u'J. Rassi', u'email': u'rassi@10gen.com'}

Message: CXX-1053 Method chaining support for validation_criteria setters

These methods now have a return type of 'validation_criteria&'. They
used to have a return type of 'void'.
Branch: master
https://github.com/mongodb/mongo-cxx-driver/commit/92812c92051f4173f144a528721d741f316ff620

Comment by Githook User [ 29/Nov/16 ]

Author:

{u'username': u'jrassi', u'name': u'J. Rassi', u'email': u'rassi@10gen.com'}

Message: CXX-1053 validation_criteria.hpp: minor docs improvements
Branch: master
https://github.com/mongodb/mongo-cxx-driver/commit/3af4fb7de529584e102fa74b8472cb28eb47c6c6

Comment by Githook User [ 29/Nov/16 ]

Author:

{u'username': u'jrassi', u'name': u'J. Rassi', u'email': u'rassi@10gen.com'}

Message: CXX-1053 Fix disengaged optional deref in 65e0c218
Branch: 3.1-dev
https://github.com/mongodb/mongo-cxx-driver/commit/22f60342c8599b92450417592177917e94cabbcf

Comment by Githook User [ 29/Nov/16 ]

Author:

{u'username': u'jrassi', u'name': u'J. Rassi', u'email': u'rassi@10gen.com'}

Message: CXX-1053 Avoid passing stdx::optional to Catch comparison expression

Catch attempts to convert comparison operands to strings with
operator<<() (in case of an assertion failure), and this causes a
compile error in some configurations when the operand is of type
boost::optional<T>, since we don't currently include optional_io.hpp.
Branch: 3.1-dev
https://github.com/mongodb/mongo-cxx-driver/commit/65e0c218cb97941945ced532e23453e6e8c462b9

Comment by Githook User [ 28/Nov/16 ]

Author:

{u'username': u'jrassi', u'name': u'J. Rassi', u'email': u'rassi@10gen.com'}

Message: CXX-1053 database::create_collection(): call options methods in order
Branch: 3.1-dev
https://github.com/mongodb/mongo-cxx-driver/commit/06dc612734e3c9a2fadffd82656f3bd1e6e3f724

Comment by Githook User [ 28/Nov/16 ]

Author:

{u'username': u'jrassi', u'name': u'J. Rassi', u'email': u'rassi@10gen.com'}

Message: CXX-1053 Alphabetize options::create_collection members/methods
Branch: 3.1-dev
https://github.com/mongodb/mongo-cxx-driver/commit/b3d9938db86f3c1dc335810918f488c7c87438b5

Comment by Githook User [ 28/Nov/16 ]

Author:

{u'username': u'jrassi', u'name': u'J. Rassi', u'email': u'rassi@10gen.com'}

Message: CXX-1053 Add options::create_collection getters, deprec. to_document()
Branch: 3.1-dev
https://github.com/mongodb/mongo-cxx-driver/commit/52172cb2d93a5fc928ae359caeff5ff897bffa27

Comment by Githook User [ 28/Nov/16 ]

Author:

{u'username': u'jrassi', u'name': u'J. Rassi', u'email': u'rassi@10gen.com'}

Message: CXX-1053 Add options::create_view getters, deprecate to_document()
Branch: 3.1-dev
https://github.com/mongodb/mongo-cxx-driver/commit/f6c64adb6a34356ea2fdafd7e5d38f8e0fc157a4

Comment by Githook User [ 28/Nov/16 ]

Author:

{u'username': u'jrassi', u'name': u'J. Rassi', u'email': u'rassi@10gen.com'}

Message: CXX-1053 Add validation_criteria getters, deprecate to_document()
Branch: 3.1-dev
https://github.com/mongodb/mongo-cxx-driver/commit/567f71d6e91928efa62e34d5af3e11d96aa328c8

Comment by Githook User [ 28/Nov/16 ]

Author:

{u'username': u'jrassi', u'name': u'J. Rassi', u'email': u'rassi@10gen.com'}

Message: CXX-1053 Method chaining support for validation_criteria setters

These methods now have a return type of 'validation_criteria&'. They
used to have a return type of 'void'.
Branch: 3.1-dev
https://github.com/mongodb/mongo-cxx-driver/commit/92812c92051f4173f144a528721d741f316ff620

Comment by Githook User [ 28/Nov/16 ]

Author:

{u'username': u'jrassi', u'name': u'J. Rassi', u'email': u'rassi@10gen.com'}

Message: CXX-1053 validation_criteria.hpp: minor docs improvements
Branch: 3.1-dev
https://github.com/mongodb/mongo-cxx-driver/commit/3af4fb7de529584e102fa74b8472cb28eb47c6c6

Comment by J Rassi [ 18/Nov/16 ]

Marking this ticket as a minor backwards-incompatible change, due to the new deprecations introduced, and the change in the return type for the validation_criteria setters.

Comment by David Golden [ 30/Sep/16 ]

I agree. It's also better forward compatibility in case the server changes the command format.

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