Problem faced me while working with set-ups

I got this Error while working with setups
TypeError: Cannot read property ‘split’ of null
at parseSrvConnectionString (/Users/mohanedmashaly/mflix-js/node_modules/mongodb-core/lib/uri_parser.js:39:23)
at parseConnectionString (/Users/mohanedmashaly/mflix-js/node_modules/mongodb-core/lib/uri_parser.js:225:12)
at connect (/Users/mohanedmashaly/mflix-js/node_modules/mongodb/lib/operations/mongo_client_ops.js:180:3)
at connectOp (/Users/mohanedmashaly/mflix-js/node_modules/mongodb/lib/operations/mongo_client_ops.js:284:3)
at /Users/mohanedmashaly/mflix-js/node_modules/mongodb/lib/utils.js:437:24
at new Promise ()
at executeOperation (/Users/mohanedmashaly/mflix-js/node_modules/mongodb/lib/utils.js:432:10)
at MongoClient.connect (/Users/mohanedmashaly/mflix-js/node_modules/mongodb/lib/mongo_client.js:168:10)
at Function.MongoClient.connect (/Users/mohanedmashaly/mflix-js/node_modules/mongodb/lib/mongo_client.js:372:22)
at Object. (/Users/mohanedmashaly/mflix-js/src/index.js:23:13)

Can you share the contents of your .env file with me?

Ticket: Connection

Rename this file to .ini after filling in your MFLIX_DB_URI and your SECRET_KEY

Do not surround the URI with quotes

SECRET_KEY=SOMETIMSesahasmergesortalgorthimrecalofrthimpaopoarecbacktrackiolvesolvingprobl
MFLIX_DB_URI=mongo “mongodb+srv://m220student:m220password@cluster0-yekah.mongodb.net/test”
MFLIX_NS=mflix
PORT=5000

@mohaned_13559, which part of the big bold message Do not surround the URI with quotes you did not understood?

Hey just try again removing the quotes and the first mongo word, so at the end you’ll get something like this.

MFLIX_DB_URI=mongodb+srv://m220student:m220password@cluster0-yekah.mongodb.net/test

and steevej-1495, it’ll be more polite if you use others words to help, don’t be rude with someone just because they don’t know the same like you.

2 Likes