Javascript – Why isnt my mongodb profile saving to database?
The main issue is my code saves the first time around but then will not work no matter what I try. It should be simple to save to the database and it is the first time but after that the…
The main issue is my code saves the first time around but then will not work no matter what I try. It should be simple to save to the database and it is the first time but after that the…
Main task: apply tags filters for products (could be one or multiple). Need to return filtered products list with specified dietary tags in query. Product tags field is a ref to tags collection. $lookup and related stages: { $lookup: {…
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 return the items whose name OR description contain the parameter. Here…
I would like to know how I can make a query to the database bringing all the results that meet the 'store' {name} field, but this 'store' is saved with '_id' and I use .populate() to bring me the info…
I have the following schema: const mongoose = require("mongoose"); const { ObjectId, Number } = mongoose.Schema.Types; const CategoriesSchema = new mongoose.Schema( { name: { type: String, required: true, }, img: { type: String, required: true, } } ); mongoose.model("Categories", CategoriesSchema,…
I have an array like this let arr = [a,b,c] and a collection like this {val:a},{val:b} I want to know that document with val=c is not in the collection.
I am getting error while connecting to mongoDB. I don't know what went wrong. please help me to fix this. note:-I have configure "Allow access from Anywhere" Below is the error message. MongooseServerSelectionError: Could not connect to any servers in…
I am using email, password and username to register user and storing in mongodb. I want to use next Auth to store sessions at time of registration also. I want to redirect user in same way at registration in same…
I am novice in MERN app development was attending tutorial on the same. I have to create basic MERN based application to demonstrate the fundamental working of MERN backend with nodeJS, mongoose, mongoDB, express. Following are the content of the…
Please consider the following data: { "_id": "F9F39JQH", "field": { "array": [ { "itemId": 1 }, { "itemId": 2 } ] } } I'm trying to add a single field inside the first element or the array. { "_id": "F9F39JQH",…