[CXX-2415] mongocxx::read_preference::tags(bsoncxx::document::view_or_value) should take a bsoncxx::array::view_or_value Created: 22/Nov/21  Updated: 28/Oct/23  Resolved: 12/Jul/22

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

Type: Improvement Priority: Unknown
Reporter: Adrian B Assignee: Ezra Chung
Resolution: Fixed Votes: 0
Labels: needs-first-responder
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

When reading about the Read Preference Tag Sets, we would expect the following signature :
read_preference& tags(bsoncxx::array::view_or_value tags);

In the current form (with a bsoncxx::document::view_or_value), it's unclear what is the correct usage.
Are we supposed to wrap the array in a document ?



 Comments   
Comment by Githook User [ 12/Jul/22 ]

Author:

{'name': 'Ezra Chung', 'email': '88335979+eramongodb@users.noreply.github.com', 'username': 'eramongodb'}

Message: CXX-2415 Support setting tag set list with array (#878)

  • Add missing documentation for document::view conversion operator
Comment by Adrian B [ 22/Nov/21 ]

Okay, I've found how to use it : we must use the implicit conversion array::view → document::view :

namespace bsoncxx {
namespace array {
class BSONCXX_API view {
    //...
    operator document::view() const;
    //...
};
} // namespace array
} // namespace bsoncxx

Which, by the way, isn't listed in the mongocxx documentation.

An example could be provided to help finding the proper usage of the method, but I still think that the method should take a bsoncxx::array::view_or_value.

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