collection is not defined in mongodb
Here your not declared the variable(collection) so that only you got this error.You need to declare that variable with proper collection name. For Example : If you are going to find the records in users collection under test schema you need to the follow the below code. var express = require(‘express’); var router = express.Router(); … Read more