diff --git a/lib/storage/metadata/mongoclient/LogConsumer.js b/lib/storage/metadata/mongoclient/LogConsumer.js index c539bb637..92a18f13d 100644 --- a/lib/storage/metadata/mongoclient/LogConsumer.js +++ b/lib/storage/metadata/mongoclient/LogConsumer.js @@ -2,7 +2,6 @@ const stream = require('stream'); const MongoClient = require('mongodb').MongoClient; -const format = require('util').format; const { Timestamp } = require('bson'); let lastEndID = undefined; @@ -109,9 +108,7 @@ class LogConsumer { const { replicaSetHosts } = mongoConfig; // 'local' is the database where MongoDB has oplogs.rs capped collection this.database = 'local'; - this.mongoUrl = format( - 'mongodb://%s/local', - replicaSetHosts); + this.mongoUrl = `mongodb://${replicaSetHosts}/local`; this.logger = logger; } diff --git a/lib/storage/metadata/mongoclient/MongoClientInterface.js b/lib/storage/metadata/mongoclient/MongoClientInterface.js index 2f97f4500..5d40fcd09 100644 --- a/lib/storage/metadata/mongoclient/MongoClientInterface.js +++ b/lib/storage/metadata/mongoclient/MongoClientInterface.js @@ -11,7 +11,6 @@ */ const async = require('async'); -const format = require('util').format; const constants = require('../../../constants'); const errors = require('../../../errors'); @@ -82,10 +81,8 @@ class MongoClientInterface { constructor(params) { const { replicaSetHosts, path, database, logger, replicationGroupId, replicaSet } = params; - this.mongoUrl = format( - 'mongodb://%s/?replicaSet=%s', - replicaSetHosts, - replicaSet); + this.mongoUrl = `mongodb://${replicaSetHosts}/?replicaSet=` + + `${replicaSet}`; this.logger = logger; this.client = null; this.db = null;