My query let findEvents = await eventModel.aggregate([ { $match: { participants: { $eq: event.userId }, eventStatus: { $
I am running a MongoDB server running V4.4.14 installed on VMs configured as follows: 1 Primary 2 Secondary 1 Arbiter Nodes are not on the same local network an
I am calling a DELETE request using fetch. But The request is not working. How can i solve this? Please help me!.
I want to make a mongoose schema that will append timeseries data. I got the idea for that model after reading this (https://www.mongodb.com/blog/post/schema-de
For my whole projects I have relationed my multiple collection as this. User model Name:string, email:string, password:string, vehicles:[{ "vehicleId", "vehi
I want to edit an array with mongoose, if the object id already exist in the array, then it will create a new one, and if it exist, it will update. My code: con
recipe = new Recipe(_.pick(req.body, ['name', 'tag', 'recipe'])); await recipe.save(); }); error: recipe = new Recipe(_.pick(req.body, ['name', 'tag
I had a Post Model with a ref as below const mongoose = require("mongoose"); const PostSchema = new mongoose.Schema( { _id: mongoose.Schema.Types.O
I'm Using Mongoid and I have two models: class User include Mongoid::Document include Mongoid::Timestamps embeds_many :tickets field :email, type: Str
The usual behavior in MongoDB is that collections are created upon first document insertion, which is fine for most of the use cases. However, in some cases you
I am learning Django with MongoDb and have a collection to search into. Here is a sample document in the collection: { "_id": { "$oid": "62615907568ddfc
I have 3 objects like this {"_id":{"$oid":"625f0e73b1d7269de9ebdaeb"}, "Type":"scalar", "Temperature":22.79, "Vibration":{"A-P2P":{"X":85},"Z2P":{"X":43},"Crest
I am trying my luck here, I have a model which is like the following public class RowData : BaseBsonDefinition { . [BsonExtraElements] [BsonDictionaryOption
I Write My code like this but it has error, How to rewrite this code db.collection('collection_name').insertOne({ name:req.body.name, details:[{ age:req.body.ag
What is the reason behind this error? this code I am using to connect to DB. const uri =`mongodb+srv://${process.env.DB_USER}:${process.env.DB_PASSWORD}@cluster
//** If I'm adding a new document with the name: "India", then I don't want that the DB allow another name with the name: "INDIA", "india", "indIA", etc. I'm ne
Why would MongoDb (4.2.6) return every row from an index (Collation locale: en_US, strength: 1), when searching for a string contained in the document field? E
I have this mongoose schema const PictureSchema = mongoose.Schema({ user: { type: mongoose.Schema.Types.ObjectId, ref: 'User', requi
I'm working on social media platform and I need to fetch posts for newsfeed with mongodb search query. currently I'm using dynamic index on my post collection,
I use mongoDB, after run server site 1st time all data load and display in UI. But whenever I try to show dynamic route using an event handler , and this give m