Category "mongodb"

How to add "allowDiskUse" in @Aggregation annotation in repository in Spring Boot?

I have an aggregation written in a MyRepository.kt file which is being called from MongoDataRetriever.kt file in the backend. MyRepository.kt file: import org.s

MongoDB indexes are ignored inside the $facet pipeline

I have all combination of compound indexes for this collection. The aggregattion query i used is: db.products.aggregate( [ { $facet: { "categ

How to write Debezium Connector Configuration and Debezium Listener for mongoDB in spring-boot and before, after payload as JSON?

Could anyone please provide the sample code in spring-boot for Debezium connector Listeners class and configuration class for MongoDB which provide the changed

MongoDB and MySQL transaction in a distributed transaction

I have a use case where we need to use both MySQL and MongoDB in a distributed transaction i.e. if either of MySQL or MongoDB fails, both MySQL and MongoDB must

is there any workarround on $nin slowness on mongoDB?

I'm implementing a pipeline on mongo which have this structure: db.COLLECTION.aggregate([ { $match: { $or: [ {

MongoDB Updating Boolean Inside Object

I am trying to update a boolean inside of an object in my discord.js v13 bot but it does not update here are the things i've tried: await gu

Mongoose 5.11.11 SchemaDefinition Typing

Mongoose recently updated to accept a model generic it works well with a string type but not with a boolean type. Type 'boolean' is not assignable to type 'Sche

mongodump error: x509: cannot validate certificate for <server-IP> because it doesn't contain any IP SANs

I am trying to setup mongodump along with TLS/SSL encryption. I have been following various articles for this: Self-signed SSL connection using PyMongo, https:/

Using React-Hook Form, How do I post data to my MongoDB in React Native

I am facing an issue where Im trying to post data to my mongoDB from the frontend using React Hooks on React Native. The problem is that Im struggling to get th

How to parse the collections in `mongodump` archive output using Python?

Context I have a MongoDB that is backed up every day using the following command mongodump --gzip --numParallelCollections=1 --oplog --archive=/tmp/dump.gz --re

How to Use String instead of ObjectId in "wither" Rust?

I have this code here: pub struct Account { #[serde(rename = "_id", skip_serializing_if = "Option::is_none")] pub id: Option<ObjectId>, pub em

How to Use String instead of ObjectId in "wither" Rust?

I have this code here: pub struct Account { #[serde(rename = "_id", skip_serializing_if = "Option::is_none")] pub id: Option<ObjectId>, pub em

'No write concern mode named 'majority`' found in replica set configuration' error

I'm trying to insert an object into mongodb via a POST request. The object that I send gets inserted in the db successfully, however I get the error mentioned a

How can .save give a "duplicate key error"?

I read that: .save checks if there is a document with the same _id as the one you save exists. When it exists, it replaces it. When no such document exists, it

TS2339: Property 'comparePassword' does not exist on type 'Model<Document, {}>'

I have defined a schema method by using this code. While I use in the service. It is showing a error. // model export interface User extends mongoose.Document

What is needed to be able to make a backup of mongo database

I am trying to make a backup of mongo database, but I keep getting authentication errors. I gave my user all the privileges I could and I still cannot do a back

most efficient way to count docs in mongodb

I have a reasonable collection with a 7.1m docs. I have indexes in place to be able to query and fetch data as needed, all good. But as soon as i try to count,

Duplicate data from Mongo Atlas to self-managed mongodb

I need to duplicate records about 400 million records from Atlas Mongodb to self-managed Mongodb without any changes. After finishing migrating data, these 2 da

How to use mongodb lookup aggregation with sort?

From my connection_dags_archived collection, the following lookup works, giving me the joined items in an array: But when I wish to move it into a pipeline to

how to send ObjectID with ajax to backend (Node.JS) [closed]

font-end code(HTML, Javascript) I want to make delete button but i can't send ObjectID with ajax var retName = $(this).data("row-id"); $.