[CXX-1577] Flexible collection creation Created: 05/May/18  Updated: 28/Oct/23  Resolved: 26/Sep/18

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

Type: Improvement Priority: Major - P3
Reporter: A. Jesse Jiryu Davis Assignee: A. Jesse Jiryu Davis
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Problem/Incident
is caused by CXX-999 Support read-only views Closed
Related
related to CXX-1932 Provide an idiomatic way to create no... Closed

 Description   

We have a strongly-typed options::create_collection class that doesn't accept flexible BSON options. It has to deprecate fields whenever the server drops them (such as "autoIndexId") and add them whenever the server does (such as "validationLevel"). This also leads to excessive additions to the API; for example, create_view was added in CXX-999 to create non-materialized views, whereas other drivers simply allowed users to pass "viewOn" the same as any other BSON option.

Deprecate and remove all the strongly-typed fields in options::create_collection and allow an arbitrary document of arguments passed to the createCollection command. The actual options::create_collection class may be deleted or just shrunk, I'm not sure. Deprecate and remove database::create_view, there's no need for a separate member function for that rare use case. (Additionally, options::create_view includes a write concern, documented as "Write concern that will be used when computing the view." I think the server ignores this write concern.)



 Comments   
Comment by Githook User [ 28/Sep/18 ]

Author:

{'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com', 'username': 'ajdavis'}

Message: CXX-1577 Simpler flexible create_collection method
Branch: master
https://github.com/mongodb/mongo-cxx-driver/commit/cfb8ad75f77385e270f8edde6c123658daea3c21

Comment by Githook User [ 26/Sep/18 ]

Author:

{'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com', 'username': 'ajdavis'}

Message: CXX-1577 Flexible create_collection method
Branch: master
https://github.com/mongodb/mongo-cxx-driver/commit/76acbc45ce424e56ccb62db9b01c0459aa9aceaf

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