Results for mongoose
I have two models, Pokemon and Attacks. The Pokemon model has an array of moves as strings, which I would like to populate with the Attacks collection...
The main purpose is to get the total price of the orders array of objects. So I used mongoDB aggregation operation. I used NoSQL booster to check quer...
I have an online game store and code that filters data by tags and genres. But I also want to add filtering by platforms and systems. For example, the...
I have the following document in my cart collection: { "_id": { "$oid": "6555453298c59137f9cb2ee5" }, "userId": { "$oid": "6555453298c59137f9cb2ee...
How do I prevent this senario Request 1:I fetch document A and change something Request 2:I fetch document A and change something else Request 1:I sav...
For brief context, I'm creating a web app using ReactJS, Node.js + mongoDB. It's purpose is to hold lists of meals and products, and from them you can...
Attempting to connect to MongoDB via a follow-along, and I keep getting this error: The uri parameter to openUri() must be a string, got "undefined"...
I am, on purpose, adding a duplicate user in using model.save to test a fail scenario. Mongoose correctly returns an error {"index":0,"code":11000,"ke...
I'm trying to connect my app.js to MongoDB. Worked the last time. This time, in this new project, it won't connect. And I don't get a console log. Nei...
enter image description here I try to update the data in MongoDB Compass via Nodejs in the picture by using findByIdAndpUpdate. Below is the code that...
I want to let the front end know if there is a validation issue such as a duplicate submission ID. I have ready many stack posts already and tried the...
I have a problem with chaining populate in Mongoose. I have a pet schema and I have declared a method like this: petSchema.methods.populateForLang = a...
I am trying to create a multitenant DB with node js and MongoDB, and it works fine, I can create a new database with a tag, for example: main database...
"error": { "ok": 0, "code": 5107201, "codeName": "Location5107201", "$clusterTime": { "clusterTime": { "$timestamp": "7292060947630260235" }, "signatu...
I have the following two schemas: Blog Schema: const blogSchema = new mongoose.Schema( { title: { type: String, min: 3, max: 20, required: true ...
I have 3 Mongoose collection: Board, Thread and Reply. Each Reply belongs to 1 Thread and each Thread belongs to 1 Board. When I want to add a new Rep...
I have just started to use next.js and whenever I call api which has reference to another document, mongoose throws an error to me stating that "Schem...
I want to find user by its _id and verify if he had or not btc in his wallet? users = { "_id": "6515a3cb181eafcdd26460ce" "wallet": [ { ...
I'm using Mongoose findByIdAndUpdate to update the location field in this Mongoose schema: import mongoose from "mongoose"; const UserSchema = new mo...
I return a mongoose find query in a nextjs (version 13.5) server action and encounter 'Maximum call stack size exceeded' error. I think the main cause...
I am learning Next.js from this youtube video Next.js 13 Full Course 2023 and here he tells about "match" that he uses as a requirement for the data t...
I'm encountering an issue with my Node.js application using MongoDB and Mongoose. I have a schema defined in Mongoose with an array field, and I'm try...
I am trying to form a search query with mongoose.find() but I keep getting an error back and I am not sure why. It receives a query parameter and retu...
I want to cjeck if my document has a media url so it should has a media type too so i added this validator mediaURL: { type: String, ...
I am using express with typescript. On the login function I get the googleId from the user DB document, I get the shift created by the google id (auth...
How do I undo the most recent local commits in Git?
How can I remove a specific item from an array in JavaScript?
How do I delete a Git branch locally and remotely?
How can I find all files containing a specific text (string) on Linux?
How to find all files containing specific text (string) on Linux?
How do I revert a Git repository to a previous commit?
How do I create an HTML button that acts like a link?
How do I check out a remote Git branch?