I am using mongodb cluster with mqemitter-mongodb.
But, I notice that there is some bug about database names.
The error log is like this:
/??/??/??/??/??/node_modules/mongodb/lib/topologies/replset.js:346
throw err;
^
MongoError: database names cannot contain the character '.'
at Function.create (/??/??/??/??/??/node_modules/mongodb/lib/core/error.js:44:12)
at validateDatabaseName (/??/??/??/??/??/node_modules/mongodb/lib/operations/db_ops.js:557:24)
at new Db (/??/??/??/??/??/node_modules/mongodb/lib/db.js:190:3)
at MongoClient.db (/??/??/??/??/??/node_modules/mongodb/lib/mongo_client.js:275:14)
at /??/??/??/??/??/config/mqemitter-mongodb.js:46:25
at result (/??/??/??/??/??/node_modules/mongodb/lib/operations/execute_operation.js:75:17)
at executeCallback (/??/??/??/??/??/node_modules/mongodb/lib/operations/execute_operation.js:68:9)
at err (/??/??/??/??/??/node_modules/mongodb/lib/operations/connect.js:193:7)
at connectCallback (/??/??/??/??/??/node_modules/mongodb/lib/operations/connect.js:343:5)
at topology.connect.err (/??/??/??/??/??/node_modules/mongodb/lib/operations/connect.js:475:7)
But, the library doesn't have database option. The library get database name from uri by using url parser, and it produces inadequate results. When I put uri for mongodb cluster such as mongodb://<user>:<pw>@<server1>:27017,<server2>:27017,<server3>/aedes?ssl=true&replicaSet=<someReplicaSet>&retryWrites=true&w=majority, then the url parser which is urlModule.parse produces not aedes but :27017,<server2>:27017,<server3>/aedes.
I think that there is 2 solution. The first one is making database option for MQEmitterMongoDB fuction which let a developer set custom database name. The second solution is improve uri parsing logic.
I am using mongodb cluster with mqemitter-mongodb. But, I notice that there is some bug about database names.
The error log is like this:
The config of mine is like this:
But, the library doesn't have
database
option. The library get database name from uri by using url parser, and it produces inadequate results. When I put uri for mongodb cluster such asmongodb://<user>:<pw>@<server1>:27017,<server2>:27017,<server3>/aedes?ssl=true&replicaSet=<someReplicaSet>&retryWrites=true&w=majority
, then the url parser which isurlModule.parse
produces notaedes
but:27017,<server2>:27017,<server3>/aedes
.I think that there is 2 solution. The first one is making database option for MQEmitterMongoDB fuction which let a developer set custom database name. The second solution is improve uri parsing logic.