Javascript – how fix error: MongoNotConnectedError: Client must be connected before running operations
HY all , I have a problem when I running this code:- the file productinit.js const product = require('../model/product'); const mongoose= require('mongoose'); const connectDB = async () => { await mongoose.connect('mongodb://127.0.0.1:27017/orders', {bufferTimeout: null}); console.log('Connected to MongoDB'); }; connectDB(); const products…