i want to connect to mongodb database using mongoose, the url is http://localhost:27017/files
but i get the error which says
missing db argument
new Grid(db, mongo)
what can be the problem given the code:
let express = require('express');
let app = express();
let bodyParser = require('body-parser');
let mongoose = require('mongoose');
mongoose.connect("http://localhost:27017/files",{useNewUrlParser:true});
let conn=mongoose.connection;
let multer=require('multer');
let GridfsStorage=require("multer-gridfs-storage");
let Grid=require("gridfs-stream");
Grid.mongo=mongoose.mongo;
let gfs=new Grid(conn.db);
the same question is already there in stackoverflow but the solution does not work for me and i have searched a lot on the internet but...
any help will be highly appreciated.