Category "mongodb"

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:

How can I use partialFilterExpression on a mongoose model

I have created a mongoose model that has an email field. I want it to be unique if a value is provided by a user but I want it to be empty is a user has not pro

Spring MongoDB query sorting

I'm fairly new on mongodb, and while I'm trying to make ordered mongodb query. But spring data mongodb's sort method is deprecated. So I used org.springframewor

No common protocol found when add shard in local network

I'm trying to build a small cluster using mongodb sharding. I tried with everything in localhost and it works perfect. But when I try on my local network where

Why is mongorestore painfully slow?

I took a dump of a db having only 1 collection and two indices. The collection had roughly 6.5 million documents. When I tried to restore it, much to my surpris

MongoDB Error ( ETIMEOUT _mongodb._tcp.cluster0.ye1nx.mongodb.net )

I'm getting this error when I run my app.js file Error: querySrv ETIMEOUT _mongodb._tcp.cluster0.ye1nx.mongodb.net I am trying to console the database list but

MongoDB Driver Builders<dynamic> dont work on equal to date

I am unable to get the result I wanted when I try to get Date equal to. FilterDefinition<dynamic> searchFilter = FilterDefinition<dynamic>.Empty; st

MongoDB Driver Builders<dynamic> dont work on equal to date

I am unable to get the result I wanted when I try to get Date equal to. FilterDefinition<dynamic> searchFilter = FilterDefinition<dynamic>.Empty; st

spring data MongoDB maintaining data integrity in bulk update

I have a scenario where list of say 1000's employees (sample below) where their balance is updated at every month end where balance of each employee can be diff

MongoDB BsonDocument - Serialize JSON as key-object

I have a doubt if it is possible to serialize a collection of BsonDocument results as a JSON pair of key objects. For example, I attach a piece of code that cre

How to stream data from Kafka to MongoDB by Kafka Connector

I want to stream data from Kafka to MongoDB by using Kafka Connector. I found this one https://github.com/hpgrahsl/kafka-connect-mongodb. But there is no step t

Insert a document with Flask-PyMongo

I have a MongoDB database and I want to use Flask-PyMongo to work with it in my Flask app. How do I add a database and a collection so I can add user documents