Category "mongodb"

Enable Mongo free-monitoring on a AWS EC2 instance?

I'm trying to enable the MongoDB Free Monitoring on an EC2 instance, but I got the error: Unable to get immediate response from the Cloud Monitoring service. W

AfterDeleteEvent from AbstractMongoEventListener is not being triggered when entry is deleted from MongoDb

I have a class that extends AbstractMongoEventListener and overrides onAfterSave and onAfterDelete. The onAfterDelete does not trigger for some reason. The onAf

How to solve Vercel 500 Internal Server Error?

I have created a project that uses MongoDB to store user info and Next-Auth to authenticate users. On local host this is all working seamlessly. Previously I ha

How to query a document mongodb and react

I wonder why this is not working… This function should return true if there are any documents that match query. Thing I want to do is if the frequency is

MongoDB connetion will not close in Jest afterAll()

Here's the current state of my setup and tear down methods: beforeAll(async () => { // await populate(); try { await client.connect(() =>

Is there anyway working with schemas in Deno?

I am trying to store and work with a similar to following structure data using Deno and MongoDB. [ { id: "AAPL", stockData: [

How to Insert new documents according to a condition that can be appliyed on one of them

I have a collection where I store unique uID for a user and I also have to register them manually. While registration I pass multiple IDs in an array and now I

Is there a way to cast a string of only hh:mm to Date in Javascript

I have a business hours object in a mongoose schema that represent a date. I'm passing a json object and retrieving the to parse to Date as string. I wonder if

How to make a query includes both count and data of collection

Example data [ { owner: '0x123124124', createdAt: '13 May 2022 at 04:20:21 UTC'}, { owner: '0x123124124', createdAt: '13 May 2022 at 06:20:21 UTC'}, {

Where do I find my dbname for MongoDB connection string?

I'm trying to connect my app to mongodb, and I got a connection string from mongodb atlas, requiring me to replace username and password, which I get it, but it

Query over a field which is deep inside MongoDB collection using array of possible options

I have a list of commentDocument collection in MongoDB where each has the following structure: { "commentName": "test comment", "outputs": { "ex

Why can't I connect to mongoDB atlas?

I am new in MongoDB, all my life I used MySQL. I have created an account in atlas, set the IP to my IP and created a user and saved the password. here is my cod

How to query Child Reference Pattern collection with $graphLookup

I have a collection with child reference. Each document can have multiple parents. How can I query it with $graphLookup in order to make a result prepared for a

How to upload a single image file with next.js to mongodb?

When I'm uploading form data to mongodb, in the image section it shows this: "C:\fakepath\imageName.jpg" with no actual image in it. And when I fetch the data f

MongoStore.create({ ..............Cannot read property 'create' of undefined

I have tried every possible step I've come across but the problem doesn't resolve. The error shows: C:\Users\...............\server.js:35 store: MongoStore.crea

Is there a way to avoid stringValue Favicon.ico error in express js

I am trying to build an application in my Express and anytime i navigate to the admin page i get this error const castError = new CastError();

Access root document map in the $filter aggregation (MongoDb)

I apologize for the vague question description, but I have quite a complex question regarding filtration in MongoDB aggregations. Please, see my data schema to

MongoSQLd not starting on Windows

I'm very new user of Mongo and I'm trying to enable MongoDB connector for BI. I want to change my connect address, but it only connects to 127.0.0.1... I made a

How to delete and insert with a single command in mongoDB?

So, I have a collection like this: [{ "name":String, "address":String, "hobby":Array of Strings }...] Every hour I query an API and get the response l

how to replaceOne document in MongoDb with Mongo database command

We have requirement to execute replaceOne operation with db.runCommand() I checked list of commands from here, but i haven't found any command to replace one do