I'm building a pretty simple next.js app for a client and for my life I cannot figure out why I keep getting Cannot overwrite User model once compiled. It seems
const ChatSchema = new mongoose.Schema({ username: { type: String, }, mobile: { type: Number, }, friends: [ { type: mongoose.Schema.
What I'm trying to achieve: Use one Schema (Ingredient Schema) inside another one (Recipe Schema). My goal is that in the Recipe Schema, my ingredients key to b
How do I delete object from inner schema in mongoose? I try to delete comments from the Holiday Schema, this is the holiday schema: const holidaySchema = new mo
I have the following setup in Visual Studio Code for nodejs project: Model: genre.js const Joi = require('joi'); const mongoose = require('mongoose'); const
i am using mongo db to fetch and post the data but unable to post more than 1 request here is my code ON posting the different values second time i am getting t
I'm trying to find the id of an object inside an array of objects. That _id has the same field name _id as others in the document. This is my model (brief) var
For some reason, swagger-autogen is reversing the order of my properties in my swagger.json output file. For example, I have a simple 'user' mongoose schema set
The above query returns a 200 when I try to create a User, but whenever I log into MongoDB there is no collections created. Can anyone help ? //user model co
In documentation there's deleteMany() method Character.deleteMany({ name: /Stark/, age: { $gte: 18 } }, function (err) {}); I want to remove multiple documents