Category "mongodb"

TypeError: Cannot assign to read only property 'message' of object 'SyntaxError: unknown: Missing semicolon. (1:12)

I am New to Mongo and Started Learning from Mango Basics. i am following the course and when I tried to write the Mongodump it is giving "SyntaxError: Missing s

express-session unable to retrieve session variable

I am using express-session to store my sessions persistently on a MongoDB database. The project worked perfectly in a development environment but for some reaso

Best way to structure deep time-series data in MongoDB?

I'm migrated from MySQL to MongoDB and looking to optimize the storage of my time-series data. Each item in my database has an array of values for multiple loca

Why does My chrome Browser show the issue "Audit usage of navigator.userAgent, navigator.appVersion, and navigator.platform"?

My chrome browser suddenly shows an issue like that A page or script is accessing at least one of the navigators.UserAgent, navigator.appVersion, and navigator.

Setting up a SSL certificate for a MongoDB server that prevents connections from MongoDBCompass and the NodeJS application

I want to add a SSL certificate to my MongoDB server to have an extra level of security. But with the SSL certificate, it is impossible to connect with "MongoDB

I'm looking to get completed events counts but this query not working

My query let findEvents = await eventModel.aggregate([ { $match: { participants: { $eq: event.userId }, eventStatus: { $

MongoDB Replicaset - How to solve "Could not find self in current config" on Secondary node

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

In my MongoDB project i'm facing this problem: "DELETE http://localhost:5000/user/undefined 404 (Not Found)"

I am calling a DELETE request using fetch. But The request is not working. How can i solve this? Please help me!.

Set mongoose schema with changing fields

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

Which relation in MongoDB is better?

For my whole projects I have relationed my multiple collection as this. User model Name:string, email:string, password:string, vehicles:[{ "vehicleId", "vehi

How to upsert object in Mongoose Array?

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

ReferenceError: "_" is not defined

recipe = new Recipe(_.pick(req.body, ['name', 'tag', 'recipe'])); await recipe.save(); }); error: recipe = new Recipe(_.pick(req.body, ['name', 'tag

Populate Failed immediately a ref was indexed in Mongodb via Mongoose Schema

I had a Post Model with a ref as below const mongoose = require("mongoose"); const PostSchema = new mongoose.Schema( { _id: mongoose.Schema.Types.O

How to get all embeds_many items in Mongoid

I'm Using Mongoid and I have two models: class User include Mongoid::Document include Mongoid::Timestamps embeds_many :tickets field :email, type: Str

insert with "error on non existing collection" semantics

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

Django pymongo search, sort, limit on inner array and count them

I am learning Django with MongoDb and have a collection to search into. Here is a sample document in the collection: { "_id": { "$oid": "62615907568ddfc

Mongodb: Merge nested objects based on common identifier

I have 3 objects like this {"_id":{"$oid":"625f0e73b1d7269de9ebdaeb"}, "Type":"scalar", "Temperature":22.79, "Vibration":{"A-P2P":{"X":85},"Z2P":{"X":43},"Crest

How to projection fields for a dictionary (C#, MongdoDB)

I am trying my luck here, I have a model which is like the following public class RowData : BaseBsonDefinition { . [BsonExtraElements] [BsonDictionaryOption

How to insert array to object using postman and nodejs. Send the data to mongodb

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

Error message : MongoServerError: bad auth :Authentication failed

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