Category "mongodb"

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.

nodejs multer retrieve stored images to the client side

I have created file storage in nodejs application to store images in uploads folder. which works fine but now I want to display those images I have read some ot

Listing users for certain DB with PyMongo

What I'm trying to acheive I'm trying to fetch users for a certain database. What I did so far I was able to find function to list the databases or create us

Fuzzy Searching with Mongodb?

I have managed to set up a search feature in my mongodb app. See the code below. This works very well however it only returns exact results. How would I change

Mongodb SSL - unable to get issuer certificate

I am trying to configure ssl/tls with mongod on ubuntu 20.04 LTS. mongod version is 5.0.5. For generating ssl/tls, I am using ssl/ssl certificates from let's en

How can I type annotate a PyMongo Collection?

I'm currently using: from typing import Type from pymongo.collection import Collection def collection_type_test(example_collection: Type[Collection]) -> lis

MongoDB find documents with a field not empty, IF EXISTS

I want to be able to query documents having a specific field's value not empty, if the field is present. Normally I'd do something like: client_comment: { '$exi

mongoDB, connection refused

Show my code conf.set( "mongo.input.uri" , "mongodb://127.0.0.1/stackoverflow.mrtest" ); conf.set( "mongo.output.uri" , "mongodb://127.0.0.1/stackoverflow.mrte

BSONTypeError: Argument passed in must be a string of 12 bytes or a string of 24 hex characters

Need some help here. Tried almost everything that I found at the internet, but didn't works. So, this is my code: const id = req.params.id.trim(); Blog

MongoDB Merge Equivalent Collections

I have two collections with same structure and want to merge them in aggregation result and query & sort over them after merging. E.g.; First collection: