175,441 questions
0
votes
2
answers
441
views
MongoClient "TypeError: Converting circular structure to JSON"
I am working for a Backend application. When I am testing with Thunder Client data is not coming by id and instead I get an error.
Here is the screenshot:
Error is
[nodemon] starting `node server.js`
...
0
votes
1
answer
118
views
Mongoose "Error: User validation failed: accountStatus: `SUSPEND` is not a valid enum value for path `accountStatus`., roles.0:"
When I hit the route from Thunder Client, I get the following error:
{
"message": "Server Error Occurred"
}
Error: User validation failed: accountStatus: `SUSPEND` is not a valid ...
0
votes
0
answers
1k
views
ServerSelectionTimeoutError: localhost:27017: [Errno 111] Connection refused [duplicate]
I was coding a Python spider, and I use Mongo database to store the webpage's HTML and the crawl_queue_list. At first, it runs well, I could create connection to the Mongodb ('localhost', 20717) and ...
1
vote
1
answer
191
views
500 Internal Server Error when `delete user.password()` [closed]
I am using Thunder Client for testing backend application. I encrypted password and jwt token token generated.
http://localhost:4000/login
When trying to login it gives me message- Status: 500 ...
1
vote
3
answers
3k
views
How to filter with pagination efficiently with millions of records in mongodb?
I know there are a LOT of questions regarding this subject. And while most work, they are really poor in performance when there are millions of records.
I have a collection with 10,000,000 records.
At ...
0
votes
1
answer
172
views
How can I update my server file so that I can have the server up and running?
I am running my backend using mongodb and express. I am restarting the server using nodemon. After running:
npm run dev
I am getting the error below:
> [email protected] dev
> nodemon server.js
[...
-4
votes
1
answer
62
views
How to precompute nested date ranges efficiently to optimize range filtering and pagination? [closed]
📝 Body
I have a Mongo collection CollectionA where each top-level object contains a nested array of meetings now each meetings have start and end times, for example:
CollectionA = [
{
&...
0
votes
1
answer
68
views
How to connect from host machine to a MongoDB Docker container with replica set enabled?
I'm running MongoDB inside Docker with a replica set enabled, and I want to connect to it from my host machine using MongoDB Compass.
Here’s my docker-compose.yml snippet:
services:
mongo:
...
0
votes
0
answers
77
views
How to deserialize polymorphic objects in MongoDB?
I am developing a project using Kotlin and the Quarkus framework (version 3.20 LTS), that connects to a MongoDB database, which has already been populated previously with some documents using the ...
39
votes
3
answers
34k
views
Setting default database for MongoDB shell
When I go into the mongo shell in my terminal, it always starts with the database test, which is the wrong database. Can you set mongo to start in a specific database?
2
votes
1
answer
71
views
Mongodb v6.0.16 boost error when building from source with scons: run_it<FutureExecutorContinuationSharedState>' has no member named 'that'
I'm trying to build an older version of Mongod on Arch Linux.
It's required by software called Deadline that I intend to use; Deadline's documentation says the following: "For maximum ...
79
votes
31
answers
138k
views
Why is PyMongo 3 giving ServerSelectionTimeoutError?
I'm using:
Python 3.4.2
PyMongo 3.0.2
mongolab running mongod 2.6.9
uWSGI 2.0.10
CherryPy 3.7.0
nginx 1.6.2
uWSGI start params:
--socket 127.0.0.1:8081 --daemonize --enable-threads --threads 2 --...
-1
votes
1
answer
349
views
Time zone with mongooseJS
I have a model which stores the current date of each record, but the date is being saved for another time zone,
var mongoose = require('mongoose'),
Schema = mongoose.Schema;
var TicketSchema = new ...
2
votes
1
answer
14k
views
How to connect to Mongodb in Apache Airflow?
I am trying to process data from external source and store it in my MongoDB. So I am trying to understand how should I access Mongodb Hook in my operator.
1
vote
0
answers
37
views
MongoListener (Java) not reading from MongoDB collection on local Docker
I have a MongoDB Docker container, running locally. I have set this up using the following file, docker-compose.yml
services:
mongodb:
container_name: mongodb-local
image: mongo:latest
...
11
votes
4
answers
19k
views
DocumentDB/MongoDB UpdateOne - Retryable writes are not supported
I have following bulk_write to upsert each document from my dataset to a collection.
data = [] # list of dicts/documents
mongo = MongoClient('some_host')
db = mongo['some_db']
collection = db['...
1
vote
0
answers
53
views
Mongodb not available for my AWS Lambda function
I have tried to import mongodb into my lambda function and I keep getting an error message when I attempt to test it. All the recommended resolutions I have seen assume I am working in an environment ...
2
votes
3
answers
9k
views
MongoDb.Driver. Authentication via SCRAM-SHA-1
i'm trying to establish a connection with Azure Cosmos DB (MongoDb). I use MongoDb.Driver v2.8.1. Could anyone help me ? Thanks a lot.
var configurationSection = _configuration.GetSection("...
1
vote
2
answers
6k
views
Error: Cannot find module '../models/User' - Mongoose schema
I'm importing a module in my Sapper application, but I'm getting the error Cannot find module '../models/User'
Imported with const User = require('../models/User');
Exported as module.exports = User = ...
2
votes
1
answer
113
views
MongoDB C# Driver: Update only provided fields, including setting some fields to null
I am using MongoDB with C# (MongoDB.Driver) and I want to update only the fields provided in my API model. My current approach works for updating values, but I cannot set a field (string, number, or ...
1
vote
1
answer
57
views
Ways to dynamically upload, store, and show images with react?
I have a sort of strange use case. I have to create a design history journal, and I decided the best way to go about it would be to create a submission form in a create-react-app where I can upload a ...
4
votes
1
answer
12k
views
How to solve error: No server chosen by ReadPreferenceServerSelector
I'm very new to Java and MongoDB (or any databases) and I have been building this Java program to test the connection. It's supposed to just simply establish the connection and list all existing ...
6
votes
7
answers
12k
views
MongoDB - MongoError: connect ECONNREFUSED
I keep getting an error when trying to connect mongoDB. I know there are many questions similar to this one and I have checked all of them and haven't found a solution for my issue.
Here is the exact ...
0
votes
2
answers
4k
views
MongoDB BsonDocument to DataTable and vice versa
For some reason, I would like to store a ADO.NET DataTable inside a BsonDocument, but I am surprised that the official C# driver (2.0) refuses to serialize DataTable as array of BsonDocuments. I know ...
1
vote
1
answer
60
views
Azure CosmosDB for MongoDB not sorting using _id index? [closed]
Trying to figure this out, running a simple query like this
.find()
.sort({ _id: 1 })
.limit(100)
.hint({ _id: 1 }).explain("executionStats");
And it's doing a full scan everytime
...