ppkarwasz commented on PR #3322:
URL: https://github.com/apache/logging-log4j2/pull/3322#issuecomment-2561871496

   @garydgregory,
   > I'm not a fan because this creates confusion with the connection string. 
IMO: It should be that EITHER you provide a connection string OR you provide 
all the bits and pieces to build a connection string. I don't like the idea of 
doing it half one way and half the other.
   
   These were my initial thoughts too, until I dug deeper into the connection 
string.
   From what I have understood from the connection string (mainly [this 
documentation](https://www.mongodb.com/docs/manual/reference/connection-string/#standard-connection-string-format)),
 it does **not** provide neither the database nor the collection name:
   
   - it does not contain the database name, because the `defaultauthdb` part is 
the name of the database, where the user is defined, not the database that will 
be used by the MongoDB client. The MongoDB client can use any database 
available on the server. Did I misinterpret this part?
   - the official connections string does not even have a "collectionName" 
part. The collection name is only defined by the Java-specific 
[`ConnectionString`](https://mongodb.github.io/mongo-java-driver/5.2/apidocs/mongodb-driver-core/com/mongodb/ConnectionString.html).
 So Java developers might know this alternative syntax, but MongoDB 
administrators might not know it.
   
   As I mentioned before, I have almost no experience with MongoDB, so these 
interpretations might not make sense.
   
   > Just like with JDBC, you just need to know a driver's connection string 
syntax, which invariably changes from time to time, and I certainly don't want 
to have to change this code because there is some Mongo driver change in some 
version that breaks our code.
   
   For JDBC you also need to provide the name of the table.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@logging.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to