adrianhajdin / project_next_14_ai_prompt_sharing

Next.js recently became the official React framework as outlined in React docs. In this course, you'll learn the most important Next.js concepts and how they fit into the React ecosystem. Finally, you'll put your skills to the test by building a modern full-stack Next 14 application.
https://www.jsmastery.pro/ultimate-next-course
2.83k stars 416 forks source link

Problem with findByIdAndRemove in mongoose 8.0.0 #71

Open Amir-Kermanshahani opened 11 months ago

Amir-Kermanshahani commented 11 months ago

If you installed Mongoose v8.0.0, you'll hit an error on prompt deletion. The problem is that in Mongoose v8.0.0, the "findByIdAndRemove" query is replaced with "findByIdAndDelete". you can check the version of Mongoose and if you were using this version, just replace it as I said in the "app/api/prompt/[id]/route.js" file.

mattsnow commented 9 months ago

Thanks Amir, facing this exact same problem.