Category "mongodb"

How to find items in a collections which are not in another collection with MongoDB

I want to query my mongodb to perform a non-match between 2 collections. Here is my structure : CollectionA : _id, name, firstname, website_account_key, emai

Mongoose - remove multiple documents in one function call

In documentation there's deleteMany() method Character.deleteMany({ name: /Stark/, age: { $gte: 18 } }, function (err) {}); I want to remove multiple documents

How to do type conversion when transferring data from MongoDB to kafka with debezium?

In Mongodb, the objectid is base64. I'm streaming these docs to Kafka using Debezium. How can I get ObjectId to be written as UUID in kafka? Mongo Example Doc :

mongo - insert documents to other collection based on query

I am trying to insert documents to a collection based on a query So I wrote the query, and then for each, How do I read info from the "doc" result document from

com.mongodb.MongoTimeoutException when using MongoClient with list ServerAddress

I'm trying to deploy a replica database onto one server with different port and connect with it. Everything is ok if I just use single ServerAddress and connect

In MongoDB, method to keep the previous value of a field in a different field while updating an object?

Say I have an object with field state, I want to update this field, while keeping the previous value of state in previous_state field. First, I have tried to ma

MongoDb error: cannot use 'j' option when a host does not have journaling enabled

I was using mongo in dev just fine, when deploying the app into test env I got this error when objects are saved in the application cannot use 'j' option when

Find duplicate records in MongoDB

How would I find duplicate fields in a mongo collection. I'd like to check if any of the "name" fields are duplicates. { "name" : "ksqn291", "__v" : 0

Compose Transporter throws error when collection_filters is set to sync data for current day from DocumentDB/MongoDB to file/ElasticSearch

I am using Compose Transporter to sync data from DocumentDB to ElasticSearch instance in AWS. After one time sync, I added following collection_filters in pipel

What's the fastest way to copy a collection within the same database?

I want to copy a collection within the same database and give it a different name - basically take a snapshot. What's the best way to do this? Is there a comm

Connecting Mongodb Atlas from Spring boot

I i am new to the Mongodb with Spring Boot.And i have MONGODB ATLAS URI Connection String mongodb://userName:<PASSWORD>@icarat-shard-00-00-7lopx.mongodb.

@DataMongoTest is creating a null MongoTemplate

I have been trying to follow the instructions in the link below to try to add an automatically configured Embedded MongoDB Instance for Cucumber Integration tes

MongoDB: multiple $elemMatch

I have MongoDB documents structured like this: {_id: ObjectId("53d760721423030c7e14266f"), fruit: 'apple', vitamins: [ { _id: 1, name: 'B7',

Mongodb + Atlas: 'bad auth Authentication failed.', code: 8000,

I've tried this and it's not working. I have the following error with Mongodb + Atlas: MongoError: bad auth Authentication failed. at /Users/cyrus/Documen

How to match multiple array elements without using unwind?

I have a collection which contains documents with multiple arrays. These are generally quite large, but for purposes of explaining you can consider the followin

Mongo DB deployment not working in kubernetes because processor doesn't have AVX support

I am trying to deploy a mongo db deployment together with service, as follows: apiVersion: apps/v1 kind: Deployment metadata: name: mongo-deployment labels:

What does "too many positional options" mean when doing a mongoexport?

mongoexport -h db.mysite.com -u myUser -p myPass -c myCollection But the response I get is: ERROR: too many positional options What's that about?

MongoDB: Filter on _id == obj._id without setting obj._id to null on insert

I'd like to configure an upsert. If _id already exists on my object, it recognizes that and updates the match. If _id doesn't exist, it should insert the new do

MongoError: bad auth Authentication failed

const uri=`mongodb+srv://${process.env.DB_USER}:${process.env.DB_PASS}@cluster0.crceb.mongodb.net/myFirstDatabase?retryWrites=true&w=majority`; When I run

Query MongoDB for documents with non-empty intersection of arrays

So - I have a Heroku + Node + Express + MongoDB app in development, and I've been playing around all day trying to figure out how to get the mongo query I want.