31 questions from the last 30 days
5
votes
1
answer
202
views
.NET 9 -> .NET 10: MongoDB query using array.Contains throws NotSupportedException
After upgrading from .NET 9 to .NET 10, a MongoDB query that used to work now throws a System.NotSupportedException during query execution. I'm looking for pointers whether this is a runtime change in ...
3
votes
2
answers
114
views
MongoDB $regexMatch error: "needs 'input' to be of type string"
I'm getting an error in my mongodb aggregation pipeline with the $regexMatch operator. I'm trying to match fields that contain ISO date strings and convert them to a different format.
Here's the ...
0
votes
1
answer
115
views
Randomly slow MongoDB queries
I have been experiencing slow mongo queries suddenly. The execution times varies very randomly. Initially I was suspecting this expensive aggregation operation :-
{
"appName": "XXXXXX&...
0
votes
1
answer
100
views
How can I clone objects without retrieving them in MongoDb?
I use MongoDb in C#. Shown below is an object I want to clone, but also I want to merge it into the same collection.
This is a simplified version of the document I use:
class MyDocument
{
public ...
3
votes
1
answer
53
views
Query not printed as expected
exports.getAllProducts = async (req, res) => {
try {
console.log(req.query);
const queryObj = { ...req.query };
const excludedFilters = ["page", "limit", "...
0
votes
0
answers
71
views
mikro-orm - reading entity data by given reference IDs
I'm kind of new to mikro-orm, trying to wrap my head around as how to correctly define
the relations between some of my entties in my collections.
The idea is to store all my pre-defined modules in ...
Advice
1
vote
2
replies
68
views
Connecting to Mongodb from inside Docker container
I want to connect to my mongodb running on my localhost machine (dockerhost) from inside a docker container. For that I have to allow connections other than localhost. Unfortunetly when using --...
0
votes
2
answers
51
views
How to correctly type $and operator in MongoDB TypeScript driver without double WithId nesting?
I'm building a strongly-typed generic MongoDB repository in TypeScript (using the official mongodb driver, v6.x).
I want to compose filters dynamically using $and, but the TypeScript type system keeps ...
1
vote
0
answers
51
views
PySpark/MongoDB Connector DataException: dataType 'struct' is invalid for 'BsonArray' during ETL
I am running a data ingestion ETL pipeline orchestrated by Airflow using PySpark to read data from MongoDB (using the MongoDB Spark Connector) and load it into a Delta Lake table. The pipeline is ...
1
vote
1
answer
46
views
Jest + Testcontainers MongoDB: Intermittent ECONNREFUSED errors running integration tests
Problem
Starting November 10th, my Jest integration tests began failing randomly with MongoDB connection errors. The tests use @testcontainers/mongodb v11.5.1 and mongodb v8.0.12.
Error:
...
Advice
0
votes
1
replies
31
views
Is Mongoid 9 compatible with MongoDB 8.2?
Looking at the compatibility page, MongoDB 8.2 isn't listed as compatible. In practice, I suspect this page is updated less often than it should be, so I wonder if Mongoid is actually fully compatible ...
0
votes
0
answers
30
views
How to debug MongoDB recurring error 314 ObjectIsBusy [migrated]
On a fresh Mongo DB 8.0 mono instance (no cluster) community edition install on Debian and through the package manager, i have a recurring error message in my logs saying this:
"c":"...
Best practices
0
votes
1
replies
49
views
Mongodb Using aggregates for advanced search
Trying to solve a conundrum I have in writing some queries.
I’ve traditionally used simple find operations (and cursor operations for paging functionalities), but need something more complex to ...
0
votes
0
answers
70
views
How to overwrite an env value with Helm
I want to deploy an app on Kubernetes with Helm. This app is composed of multiple parts, 2 of them are a Spring backend and a Mongo database.
I want to deploy theme in 2 pods and have them talk with ...
0
votes
0
answers
25
views
$vectorSearch pre filter by non existent properties
When using the $vectorSearch aggregation stage and specifying filter, using the $exists operator isn't supported, but another way of effectively doing the same thing is to check if the property value ...
0
votes
0
answers
23
views
Connect node app running in docker to mongodb running in another container [duplicate]
I've a docker-compose, that declares 2 services, a mongo bd and a python scripts. If I run this docker compose up it works fine.
services:
mongo:
image: mongo:7.0
container_name: mongo_db
...