Click here to Skip to main content
15,887,746 members
Everything / Mongoose

Mongoose

mongoose

Great Reads

by André Marcos (Advisor), GracianoSouza
React Native, Node.js and PostreSQL, a PERN stack to develop an app to support the lost pets searching process
by Sander Rossel
The seventh in a series on MEAN web development.
by Nishant_Chaturvedi
This is a multi-parts series on building web applications using react.js, node.js, express.js, and mongodb.
by sanathjs
MongoDB/NoSQL For Beginners

Latest Articles

by André Marcos (Advisor), GracianoSouza
React Native, Node.js and PostreSQL, a PERN stack to develop an app to support the lost pets searching process
by sanathjs
MongoDB/NoSQL For Beginners
by Nishant_Chaturvedi
This is a multi-parts series on building web applications using react.js, node.js, express.js, and mongodb.
by Sander Rossel
The seventh in a series on MEAN web development.

All Articles

Sort by Score

Mongoose 

19 May 2022 by André Marcos (Advisor), GracianoSouza
React Native, Node.js and PostreSQL, a PERN stack to develop an app to support the lost pets searching process
7 Sep 2015 by Sander Rossel
The seventh in a series on MEAN web development.
11 Aug 2020 by Tridib Chatterjee
I'm trying to upload multiple files from my NodeJs application to a MongoDB database using Multer. But the problem is when I'm saving the location of the file in my database only one file location is saved while others are ignored. This is...
17 Feb 2016 by Member 10314038
I would like to remove dynamically a field from a mongoose document/What I have tried:I am using $unset and when I type the value "cars.BMW" it works. But when I want to pass a parameter, which will be a car brand and then to unset it. I tried {$unset: {"cars."+brand: " "}} but the plus...
30 Jul 2017 by Member 13336398
i want to develop a travel booking website using MEAN stack development. Ticket booking can be done one month prior to the travel date. Today (30th July) i can book tickets till 30th august. Tomorrow i should be able to book tickets for 31st august. How to make it happen and how to make mongodb...
30 Jul 2017 by Thomas Daniels
You don't have to worry about creating those collections; if you insert a document in a non-existing collection, MongoDB will automatically create a collection. However if that's not sufficient because you need some special settings, use db.createCollection[^] to create the collection after...
21 Apr 2018 by komokom
i have two diffrent object on my json file and i want to connect between them with the attribute of systemName. how to do so? this is how the event object look like: and i want to get the systemName from the Systems object the contain all the systems name List. { "_id" :...
23 Jan 2019 by Member 14126318
I have a route in Node/express that is meant to add an object from a req.body form submission to a mongodb collection (using mongoose). My code was working fine for me both locally and online, but then a colleague told me that when he tested it, it was only working in google chrome, not the...
20 Feb 2020 by Member 14081431
I am trying to create a new object and saving it to database then find all the objects from database and print it out . but here it's first running the find() method even if i am calling find() method after create(). can anybody explain why is...
20 Feb 2020 by Richard Deeming
The create[^] method returns a promise. That means the method returns before the insert has completed. It returns an object which will be resolved once the operation has completed. If you want something to run after the insert has completed,...
8 Aug 2020 by Richard MacCutchan
The fairly obvious answer is that you study each of these subjects in depth and learn how to get them to work together to do what you want. There is no shortcut to becoming an experienced developer, only practice, practice, practice.
11 Aug 2020 by Tridib Chatterjee
// We loop throw the req.files array and store their locations in the temporal files array for (let i = 0; i
18 Oct 2020 by cakka
Please help. I am using mongoose, mongodb and node.js I am trying to save data array object. But, in mongodb the field always empty. My field in mongodb is "tag" It should be contain data like : [ {tag_title: "Art", _tagId:...
15 Sep 2021 by Tharinda Hashen
I have a function named getActiveUsers which helps me to find active users I first want to get data from Reward collection, which will return 100 data to rewards array. After waiting for all the results, I want to go through the retrieved...
15 Sep 2021 by Richard Deeming
rewards.map(async (reward) => ...) returns an array of Promise options. You can't directly await an array; you need combine the array into a single Promise using Promise.all, and await that instead: await Promise.all(rewards.map(async (reward)...
25 Sep 2021 by Member 15371426
I am using passport to implement a login function on my application. However, every time I try to authenticate the user, I cannot get passed the authentication and am redirected to the failure URL. I have confirmed that there is a user in the...
6 Oct 2021 by Karim Kompissi
Hello! I am currently working on a project where I would like users to be able to connect via google and save their data in my database (MongoDB). the redirection works perfectly but when I connect with my account I get an error like: Cannot read...
6 Oct 2021 by Karim Kompissi
Thank you, I succeeded. my code. public async validate(accessToken: string, refreshToken:string, profile: any, done: VerifyCallback): Promise { const newUser = new this.UserModel(); newUser.userId = uuidv4(); ...
22 Nov 2021 by mattdimicelli
I have a model ItemModel and another model, ItemInstances. Hopefully those names are self-explanatory. I want to create a virtual in my Mongoose ItemSchema that will return the number of ItemInstances that are associated with that Item and that...
23 Oct 2022 by priyamtheone
Using Node, Express and Mongoose, I'm trying to insert data into MongoDB through a POST method. The fields I'm trying to insert has a phone field on which I'm trying to assign a validation that will check if it has minimum ten digits. Otherwise,...
9 Nov 2022 by Vamsi Deepak
I am using $graphlookup with mongoose , it is working fine in mongoplay ground but in nodejs it is not giving tree structure data. Instead it is giving TreeResult as empty array Please find the below details: below is the my method in nodejs...
9 Jan 2023 by K67987
This is my schema, how would I allow only specific email to register. For example, only people with an email address ending in gmail.com can register import mongoose from "mongoose"; const UserSchema = new mongoose.Schema( { name: {...
9 Jan 2023 by OriginalGriff
Try simplifying your regex: ^[a-zA-Z0-9_.+-]+?@[a-zA-Z0-9-]+?gmail\.com$ If you are going to use regular expressions, you need a helper tool. Get a copy of Expresso[^] - it's free, and it examines and generates Regular expressions.
31 Dec 2015 by Nishant_Chaturvedi
This is a multi-parts series on building web applications using react.js, node.js, express.js, and mongodb.
23 Oct 2022 by Richard MacCutchan
You have defined phone as a Number with a minimum value of 10. If you want to validate the number of digits then it needs to be a String. See Mongoose v6.6.7: Validation[^].
21 Apr 2018 by komokom
Working with JSON - Learn web development | MDN[^]
13 Mar 2022 by Arslan Anjum 2021
I have searched a lot but couldn't solve this problem. This is the Schema const ToDosSchema = mongoose.Schema({ userId: { type: String, required: true }, ToDo: [{ Task: { type: String, ...
8 Aug 2020 by Mahdi-Soultana
i have learn a lot in Node.js mongoose react but i see the most in my city office work in eCommerce local so they have site developed by prestashop the problem is how can i work with prestashop by my knowledge Node.js React mongoose Express to...