Category "mongodb"

How would YouTube store data of who liked which videos?

If Youtube uses MongoDB as their database, then how would they store the who liked which videos information? Option 1: Store it in the Videos collection with a

Doctrine ODM query by subfield of reference-one [duplicate]

I have an existing MongoDb database: Foo { "_id": ObjectId(123456789), "name": "foo_1", "barId": 123, "sellerId": 456 } Bar { "_id"

How does mongodb decide which index to use for a query?

When a certain query is done on a mongodb collection, if there are multiple indexes that can be used to perform the query, how does mongodb choose the index for

Error: querySrv ESERVFAIL _mongodb._tcp.cluster0.abcd0.mongodb.net

My nodejs app was working fine with mongodb connection and suddenly this error got appeared. Then I tried to connect to mongodb with mongo compass and same erro

Why heroku app is not accepting the form data?

I have deployed an app on Heroku that contains a form. When someone submits the form, the content of the form is stored in an Atlas MongoDB database. This works

Bootstrap failed: 5: Input/output error while running any service on macOS Big Sur version 11.5.2

I am trying to run [email protected] service using brew services start [email protected] (facing similar error, while running httpd service or any oth

Better option for image upload (cloud) in NextJS

I'm currently developing my first real project for a client with NextJS and MongoDB and I'm having problems uploading images. I'm working with Cloudinary but it

Heroku Error. Cannot find module 'Mongoose'

For some odd reason (i have been deployed on Heroku for around 1.5 years) my instance decided to throw a weird error regarding not finding 'mongoose' after atte

How to export a MongoDB database to JSON?

It is possible to export a mongodb database to json on windows? I've already searched and the only thing that I find is to export collections. Is that the only

Delete objects that met a condition inside an array in mongodb

My collection has array "name" with objects inside. I need to remove only those objects inside array where "name.x" is blank. "name": [ { "name.x": [

querydsl cannot find symbol error in spring boot mongo

I'm trying to use @querydslpredicate and tried to add all the dependences and plugin for the same <dependency> <groupId>com.quer

Migrating to 'Morphia' from Hibernate OGM

I have been running MongoDB (5.0.7) for a number of years with Hibernate ORM & OGM. Currently using 'org.mongodb:mongodb-driver-core:4.6.0'. (2022.04.26) Us

Get the value of a field for the latest record in a collection

I have a collection rawUnits. I am getting the latest record from this collection using db.getCollection('rawUnits').find().limit(1).sort({$natural:-1}) This g

Mongo template left join between two queries

In a spring project, I'm using reactive mongodb with mongo template to return a result of type Report class. var res1 = (Flux<Report>) template.find(q

Error when running mongo image - docker-entrypoint.sh: line 381

After installing Ubuntu v20 and then installing docker: $ docker network create test-network $ docker pull mongo $ docker run --network test-network --name mo

Recurring Event between date range in JavaScript

Basically, I need to create an Event, every event will be associated with the fields startDate and endDate. "name": "First Event", "teamName": "Team A",

I am trying to host a project I built on two separate repositories

I have a MEAN stack project that is built on two separate repositories. The backend is using Node.js and handles all API routing to MongoDB Atlas. If i wanted t

Unable to persist Spring data mongodb using save on repository

I am using Spring Data Mongodb and Embeded mongoDB to persist the data. Pom.xml <dependency> <groupId>org.springframework.boot</group

Error: Request failed with status code 500 but it works after I refresh the page

When I run my Next.Js/MongoDB Project for the first time it always greets me with a "Error: Request failed with status code 500", but after I refresh the page i

mongodb shell login - password contains special characters like -(hyphen) and '(single quote)

I am trying to login to mongodb database using mongodb shell, and if the password contains any special characters like -(hyphen) or '(single quote) , it gives e