I am watching your video: https://www.youtube.com/watch?v=3kYkEVIZNZY&t=6926s:
Between 2:00 and 2:25 you create a connection to mongoose:
api/products/index.js
import db from “../../../utils/db”;
import nc from “next-connect”;
import Project from “../../../models/Project”;
const handler = nc();
handler.get(async ( req,res ) => {
await db.connect();
const projects = await Project.find({});
await db.disconnect();
res.send(projects);
});
export default handler;
I get following response while loading:
localhost:3000/api/products & http://localhost:3000/api/seed
option usecreateindex is not supported
It has something to do with mongoose upgrade I guess, even though I don´t find the solution.
Bassir Changed status to publish October 11, 2022