[JAVA-1518] Apply client settings from Map Created: 27/Oct/14  Updated: 08/Dec/17  Resolved: 08/Dec/17

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

Type: New Feature Priority: Major - P3
Reporter: Nick Scavelli Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

It would be nice to allow someone to configure a MongoClient from a Map. This would allow any system/application (however it is configured) to easily create a MongoClient from it's own configuration.



 Comments   
Comment by Jeffrey Yemin [ 08/Dec/17 ]

There doesn't seem to be much interest in pursuing this one. Closing as Won't Fix for now.

Comment by Nick Scavelli [ 04/Nov/14 ]

In hindsight, maybe this isn't a great idea. I was thinking we'd go off the config objects. So ClusterSettings would be something like Map<String, Object> cluster = map.get("clusterSettings"); Then List<Map<String, Object>> hosts = cluster.get("hosts"); etc, etc but this is ugly.

If anything it would probably makes sense to map directly from http://docs.mongodb.org/manual/reference/connection-string/#connections-standard-connection-string-format. So map.get("replicaSet"), map.get("maxPoolSize"), etc. And just represent hosts as a List of Strings "<host>:<port>".

Comment by Nick Scavelli [ 27/Oct/14 ]

And really the schema is dictated by Config object really. Whatever the the public getter method is called would map to the key.

Comment by Nick Scavelli [ 27/Oct/14 ]

Correct, but very 'json' like if you will. Map -> object, List -> array, etc. I'm assuming config could be represented in json ?

Comment by Jeffrey Yemin [ 27/Oct/14 ]

I presume we would have to define a schema for the Map.

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