Gaurav
Gaurav

Reputation: 21

"MongoParseError: No hostname or hostnames provided in connection string" occurred while upgrading Mongodb dependency in STH-Comet

I am trying to upgrade Mongodb dependency in STH-Comet by changing its version from v2.2.35 to v3.6.8 in package.json. Ref: https://github.com/telefonicaid/fiware-sth-comet/blob/master/package.json#L74

I have replace "@" by "%40" in connection string (Ref:https://github.com/telefonicaid/fiware-sth-comet/blob/master/lib/database/sthDatabase.js#L90-L96) as shown below:

connectionURL =

    'mongodb://' + params.authentication + '%40' + params.dbURI + '/' + params.database +
        (params.replicaSet ? '?replicaSet=' + params.replicaSet : '') +
        (params.authSource ? (params.replicaSet ? '&authSource=' +
            params.authSource : '?authSource=' + params.authSource) : '');

After executing the command "npm install" to start the STH component as a Node application (Ref: https://github.com/telefonicaid/fiware-sth-comet/blob/master/doc/manuals/installation.md#cloning-the-github-repository) following error occurred at debug console: "MongoParseError: No hostname or hostnames provided in connection string"

Terminal output here

Debug console output here

How I can solve the MongoParseError: No hostname or hostnames provided in connection string?

Upvotes: 2

Views: 120

Answers (0)

Related Questions