Skip to content

MongoDB Compass Local URI not connecting #98

@jeeemmyy

Description

@jeeemmyy

This is the error i am getting. Would like to know what wrong am i doing.

My URI from Local MongoDB Compass is:

mongodb://localhost:27017/?readPreference=primary&appname=MongoDB%20Compass&ssl=false
But code is not accepting it & instead throwing this error.

### ERROR:

Server running on 5000
(node:23032) Warning: Accessing non-existent property 'count' of module exports inside circular dependency
(Use node --trace-warnings ...` to show where the warning was created)
(node:23032) Warning: Accessing non-existent property 'findOne' of module exports inside circular dependency
(node:23032) Warning: Accessing non-existent property 'remove' of module exports inside circular dependency
(node:23032) Warning: Accessing non-existent property 'updateOne' of module exports inside circular dependency
D:\06 - University\FYP\Hassan\node_passport_login-master\node_modules\mongodb\lib\operations\db_ops.js:549
throw MongoError.create({ message: 'database name must be a string', driver: true });
^

MongoError: database name must be a string
at Function.create (D:\06 - University\FYP\Hassan\node_passport_login-master\node_modules\mongodb\lib\core\error.js:44:12)
at validateDatabaseName (D:\06 - University\FYP\Hassan\node_passport_login-master\node_modules\mongodb\lib\operations\db_ops.js:549:22)
at new Db (D:\06 - University\FYP\Hassan\node_passport_login-master\node_modules\mongodb\lib\db.js:190:3)
at MongoClient.db (D:\06 - University\FYP\Hassan\node_passport_login-master\node_modules\mongodb\lib\mongo_client.js:275:14)
at D:\06 - University\FYP\Hassan\node_passport_login-master\node_modules\mongoose\lib\connection.js:638:62
at D:\06 - University\FYP\Hassan\node_passport_login-master\node_modules\mongodb\lib\operations\execute_operation.js:75:17
at executeCallback (D:\06 - University\FYP\Hassan\node_passport_login-master\node_modules\mongodb\lib\operations\execute_operation.js:68:9)
at D:\06 - University\FYP\Hassan\node_passport_login-master\node_modules\mongodb\lib\operations\connect.js:193:7
at connectCallback (D:\06 - University\FYP\Hassan\node_passport_login-master\node_modules\mongodb\lib\operations\connect.js:340:5)
at D:\06 - University\FYP\Hassan\node_passport_login-master\node_modules\mongodb\lib\operations\connect.js:472:7
at Server.connectHandler (D:\06 - University\FYP\Hassan\node_passport_login-master\node_modules\mongodb\lib\core\sdam\topology.js:259:45)
at Object.onceWrapper (events.js:422:26)
at Server.emit (events.js:327:22)
at Pool. (D:\06 - University\FYP\Hassan\node_passport_login-master\node_modules\mongodb\lib\core\sdam\server.js:470:12)
at Pool.emit (events.js:315:20)
at D:\06 - University\FYP\Hassan\node_passport_login-master\node_modules\mongodb\lib\core\connection\pool.js:624:10 {
driver: true,
[Symbol(mongoErrorContextSymbol)]: {}
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: node app.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Dell\AppData\Roaming\npm-cache_logs\2021-08-10T18_19_25_135Z-debug.log`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions