Category "mongodb"

How to update a single property using PATCH method in Node JS? [closed]

I want to create a PATCH method to update a single property for my API but there is something I don't understand.

mongodb returns matchCount 1 but modifiedCount 0

I was making a web app where a card is showing the quantity of a product. There is a button also named Delivered. After clicking the button, I want to decrease

MongoServerError: bad auth

I make an app using node.js. and connect this with MongoDB. But when I start my server it gives me an error. The error is below. Example app listening on port 5

How to update key values by append the existing one for the record in MongoDb collection

I have a Collection allRecords as {'name':'tom', 'subjects':'Physics'} {'name':'jerry', 'subjects':'Maths'} I have one json file is testData.json as {names:",t

Get previous and next inside sub array in MongoDB

I have a database as below. [ { "title": "Data 1", "slug": "data-1", "sub_docs": [ { "name": "Sub Doc 1"

Mongoose.connect keeps coming back undefined

I have this mongoose.connect statement in my server.js file: const db = mongoose.connect(config.db, { 'useNewUrlParser': true, 'useUnifiedTopology': tru

How to use limit and skip in spring data mongodb repository?

I want query sublist in mongo collections using Spring Data MongoDB. My Code is like public interface SomeRepo extends MongoRepository<SomeDoc, String> {

Rust MongoDB set unique fields

How to set a unique field in the mongodb rust implementation? Are you supposed to use create_index()? async fn create_id_fields(client: Client) -> Result {

How to add ObjectId only if the ObjectID is not present in the array in mongodb using mongoose?

so I have a schema where I want to add ObjectID to an array of id's in mongoose, I tried adding it unique, but did not work. Most likely because I need to itera

How to accept multiple objects into an array NestJS

I have a feedbackQuestion schema which takes (title: string, subtitle: string, types: enum, values: enum) import { Prop, Schema, SchemaFactory } from '@nestjs/m

How do I call useQuery in a map function?

I have the below react component which is removing products from a mongodb collection based on the items in the cart. I get this error when I run the code: Comp

2 x criteria for Match showing no results

I am trying to show results where the sum of records is greater or equal to 4 and the status matches a string. If I leave off the status field it works fine but

Return an array element of an aggregation in an MongoDB Atlas (4.2) trigger function

So I am currently testing with returning an array element of a an aggregation in an MongoDB Atlas (4.2) trigger function: exports = function(changeEvent) {

I want to upload a large file to MongoDB using jQuery

I need help to upload large zip file (compressed) and save it to my MongoDB: <form action="./uploid" method="post" id="uploadForm" enctype="multipart

mongodb - combining multiple collections, but each individual query might not need all columns

Here is the scenario : We have 2 tables (issues, anomalies) in BigQuery, which we plan to combine into a single document in MongoDB, since the 2 collections (is

How to get less than or greater than value based on specific column in mongodb using node js?

Suppose that,I have a product collection named productCollection.How can i get all those products where the product's amount is less than a specific amount?What

How to maintain Audit Logs

I am storing user data in MongoDB and want to maintain activity logs for each user. eg: Who logged in and when? Which user perform certain and when they did Al

How to add key value pair in array of Mongoose response in JavaScript

I tried to do basic things. I have an array that contains multiple objects. I want to add new key-value pair in every array object. I tried this by following co

how to create mongodb composite schema in prisma using python?

File "/Users/akaash/opt/miniconda3/lib/python3.8/site-packages/prisma/generato r/models.py", line 861, in check_supported_scalar_list_type Cannot use b_boxes as

Extend golang struct/type from another package

I have done some reading and found similar threads but none seem to work for my use case. I am trying to extend mongo's primitive library specifically primitive