bradtraversy/mongo_file_uploads

files is existing in database but it's showing error message "no files exist"

Opened this issue · 2 comments

when I enter this address "http://localhost:5000/files" in my browser, I get this response "no file exists" where that file is already uploaded in database but I don't know why is this showing.

I fixed it using mongodb node.js driver connection string "2.2.12 or later".

I figured it out. Delete mongoose from package.json and run npm i mongoose then change const conn = mongoose.createConnection(mongoURI) to

const conn = mongoose.createConnection(mongoURI, {
  useUnifiedTopology: true,
  useNewUrlParser: true,
});