I have uploaded data to MongoDB
by pymongo
and I want to retrieve it in my nodeJs
. I am writing function
like this but it is not working. my collection
name is linux_trace
and my database
name is Linux_Trace_db
.
The error is
linux_trace
is not defined
const mongoose = require("mongoose")
require('dotenv').config();
const URI = process.env.MONGO_URL;
mongoose.connect(
URI,
(err) => {
if (err) throw err;
console.log('Connected to mongodb');
}
);
linux_trace.find(function (err, adminLogins) {
if (err) return console.error(err);
console.log(adminLogins)})