I have a specific question with the way the PHP Mongo driver handles figuring out setWriteConcern and setReadPreferences. From the documentation I gather that:
- You can change writeConcern at the individual insert, update, remove level.
- You can adjust the writeConcern at the connection level.
- You can use MongoCollection::setWriteConcern to set the default for this collection.
- You can use MongoDB::setWriteConcern to set the default for this database.
We are testing a sharded, replicated setup and I am wondering if I use MongoDB::setWriteConcern and later do an insert on a collection in that database without specifying any write concern will it default to the concern I did on the DB object itself?
Basically, if I set a default writeConcern, or readPreference for that matter, on a DB/Collection does that info get synced to the config servers such that all subsequent connections will default to those concerns/preferences if none are specified at the connection or query level?