[JAVA-1524] Default MongoCollectionOptions Created: 29/Oct/14  Updated: 31/Mar/15  Resolved: 10/Nov/14

Status: Closed
Project: Java Driver
Component/s: Async
Affects Version/s: None
Fix Version/s: 3.0.0

Type: Improvement Priority: Major - P3
Reporter: Nick Scavelli Assignee: Ross Lawley
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

You should be able to create MongoCollectionOptions with the appropriate default values. In other words

MongoDatabase db = ...
db.getCollection("my-col", MongoCollectionOptions.builder().build())

should be equiv to

MongoDatabase db = ...
db.getCollection("my-col");



 Comments   
Comment by Jeffrey Yemin [ 31/Mar/15 ]

Closing all resolved 3.0.0 issues, as 3.0.0 has been tagged and released.

Comment by Githook User [ 30/Jan/15 ]

Author:

{u'username': u'rozza', u'name': u'Ross Lawley', u'email': u'ross.lawley@gmail.com'}

Message: Ensure client / database / collection use default options with any set options

JAVA-1524
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/12c549800bdc7e6778bb81f5a71595ed572187d8

Comment by Githook User [ 30/Jan/15 ]

Author:

{u'username': u'nscavell', u'name': u'nscavell', u'email': u'nick.scavelli@gmail.com'}

Message: Properly use default options when specifying MongoCollectionOptions in MongoDatabase

JAVA-1524
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/a2ba4f3e13364ae0c5c7cfc7310fe54cc44ac57d

Comment by Githook User [ 10/Nov/14 ]

Author:

{u'username': u'rozza', u'name': u'Ross Lawley', u'email': u'ross.lawley@gmail.com'}

Message: Ensure client / database / collection use default options with any set options

JAVA-1524
Branch: 3.0.x
https://github.com/mongodb/mongo-java-driver/commit/12c549800bdc7e6778bb81f5a71595ed572187d8

Comment by Githook User [ 10/Nov/14 ]

Author:

{u'username': u'nscavell', u'name': u'nscavell', u'email': u'nick.scavelli@gmail.com'}

Message: Properly use default options when specifying MongoCollectionOptions in MongoDatabase

JAVA-1524
Branch: 3.0.x
https://github.com/mongodb/mongo-java-driver/commit/a2ba4f3e13364ae0c5c7cfc7310fe54cc44ac57d

Comment by Nick Scavelli [ 29/Oct/14 ]

PR here https://github.com/mongodb/mongo-java-driver/pull/275 if this is accepted.

The issue is if let's say I have someone who wants to specify a write concern. I set the write concern on the MongoCollectionOptions.builder().writeConcern(...) but I now have to set the read preference ? Seems silly.

Also same sort of issue when specifying a codec for MongoDatabase#getCollection(String, Codec, MongoCollectionOptions). The user shouldn't have to set the default settings (either if they were configured via the client or w/e).

Generated at Thu Feb 08 08:54:50 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.