Category "mongodb"

findOneAndUpdate. Select array of messages, select message object and update likes array inside it

I use mongoose findOneAndUpdate method, but could't achieve the result. I always get the same object back. No errors. Here's my code. User object: { "_id" :

Serverless deploy from M1 MacBook Pro causes invalid ELF header error

I have a serverless REST api connecting to MongoDB atlas. When making changes and running sls deploy everything deploys as normal. But when I query the DB from

How to return a query in a MongoDB database by Date, using Mongoose schemes?

I've trying to create an endpoint in my API which return the youngest and oldest person from my database using mongodb e mongoose. My database looks like that:

Return the data of a model directly instead of a dictionary Express.js and Mongoose

Probably the title isn't very clear and is a bit confusing, and to be honest, I do not really know how to ask this question since I'm new to JavaScript and Mong

React checkbox data from mongodb

I try check if checkbox is checked in mongodb or not So for isClosed my value in db is true And its working so far my checkbox is checked bcs its true in db. Bu

NextJS fetching nested array of objects from MongoDB using mongoose and getServerSideProps

I'm trying to fetch an array of objects from MongoDB, using mongoose and SSP. One hitch is that all ObjectIds must be converted into strings. Currently I'm doin

Mongo::Error::UnsupportedFeatures (Server at (localhost:27017) reports wire version (2), but this version of the Ruby driver requires at least (6).)

I'm trying to upgrade Mongoid in an Rails 4.2 app from 4.x to 5.x (5.4.1) to connect to a MongoDB 2.6. I've updated the mongoid.yml file to match the difference

cann't decrease a value by one in the UI with node.js mongodb, react

I am trying to update a value in the UI. When I click to update, I have a button that will decrease by one In the database and be displayed in the UI's quantity

Is there an elegant, easy and fast way to move data out of HBase into MongoDB?

Is there an elegant, easy and fast way to move data out of HBase into MongoDB? I want to migrate HBase to mongoDB. I am new to mongoDB. Could someone please hel

How can I solve a "MongoError: E11000 duplicate key error collection" error in Mongo?

I have created a new Mongo collection to a new project, but when I try to create a new user, I get the following error: MongoError: E11000 duplicate key error c

Mongodb backup using docker-compose

I'm very new to Docker and I'm confused about how to backup the mongodb database. I'm using 2 containers, both connected through a network. the express app cont

How to make React search component

I am doing my first Ecommerce MERN stack project but i donot know how to make search component that will take the search input and return array of matching prod

Insert data with new fields OR update conditionally using updateOne mongodb

I have a document with format like this: { "f1": "v1", "f2": { "id": 1, "sub": "subv", "updatedAt": 123 } } I have an another source that

Add older documents to stream - based on filter

I created a MongoDB watcher to create actions based on the created document. Of course, the watcher does not detect documents that are created while the service

WebFlux Spring Boot @Transactional with reactive MongoDB

Does WebFlux Spring Boot @Transactional annotation work with reactive MongoDB? I use WebFlux Spring Boot with reactive MongoDB like: id 'org.springframework

Update array object mongoDB

I have an array of objects and would like to update the count of the object where categoryId = "menu2" and subCategoryId = "1". in my mongodb i currently have t

how to sum 2 numbers in javascript before saving it in mongodb database

I'm building a web app using MERN stack. I want to sum 2 numbers then save it mongodb database. Here current num is from database and other is from input field

Update array object mongoDB

I have an array of objects and would like to update the count of the object where categoryId = "menu2" and subCategoryId = "1". in my mongodb i currently have t

How to update ISODate to two days later

How to convert a SQL query to mongodb query? Please write a mongodb query - this is my query in SQL: UPDATE user SET expireIn = DATEADD(DAY, 2, expireIn) WHE

How to create Database wallet into hyperledger-fabric?

I need to use a database (mysql/mongodb) instead of files to store the user's wallet identity into hyperledger-fabric.