I'm trying to create a file-sharing app using Multer, Cloudinary, Typescript, and Mongoose. When I'm trying to save the files uploaded by users and the data lik
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
I have documents with the following structure: {field: ["id1", "id3"]}, {field: ["id2", "id1"]} To query the documents I use aggregate({$match: {'field' : { $i
How can I login email or phone or username with password in node js and mongodb? user can login with email and password, username and password, phone and passwo
How to check spelling mistakes, grammar & punctuation errors, use of greetings & short keywords and total time to complete each single chat session in s
Mail Schema: var mail = new mongoose.Schema({ globalId: {type: String, index: true, unique: true}, from: {type: String, required: true}, beginDate:
In my Nodejs project I would just like to await a mongoose.save function before continuing with my code. The below example does not work, but can anyone help me
I'm facing this weird issue in NodeJS when using with Passport.js, Express and Mongoose. Basically, I get an error saying "Cannot set headers after they are sen
I know this question has been answered before but I can't seem to implement the changes into what im working with. I'm trying to create a daily command that rew
This code worked for a while and I don't know what I did but it gives me this error. I saw a some guys said that update the Node, but it doesn't work for me. Mi
I have two collections, Group and GroupChat. A group has a chatroom respectively. // group.model { name: string, desc: string } // group.chat.model { group:
I found this on the documentation for mongoose: Subdocuments have save and validate middleware just like top-level documents. Calling save() on the parent docu
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 am trying to add two values in a mongoose function. This the function im using: Equipa.findOne({ '_id': req.params.equipaID }, function (error, equipa) {
I have this in my backend: ad = await Ad.find({'company': companyId}).populate('creator'); And when i console.log(ad) i get this: [ { connections: [],
I have the following Schema const domain = new Schema({ created: { type: Date, default: Date.now }, last_update: { type: Date, default: Date.now }, do
I have the following Schema const domain = new Schema({ created: { type: Date, default: Date.now }, last_update: { type: Date, default: Date.now }, do
I have been working on a React application that would connect to MongoDB Atlas with Mongoose. Using nodemon and webpack for hot reloading it would reconnect to
I have all combination of compound indexes for this collection. The aggregattion query i used is: db.products.aggregate( [ { $facet: { "categ
Mongoose recently updated to accept a model generic it works well with a string type but not with a boolean type. Type 'boolean' is not assignable to type 'Sche