175,441 questions
0
votes
1
answer
50
views
Custom error objects for Mongoose schema paths
Take the following Mongoose schema.
const userSchema = mongoose.Schema({
username: {
type: String,
required: true,
unique: true,
minLength: 3
},
name: ...
6
votes
3
answers
22k
views
Environment variable MONGODB_CONFIG_OVERRIDE_NOFORK == 1, overriding \"processManagement.fork\" to false"
I tried convert standalone MongoDB to replica set with only one replica, it was required for change streams on my backend.
I found error, which don't descripted in any site in google, so here is error ...
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 ...
0
votes
1
answer
645
views
MongoDB returns "I ACCESS [conn6] Unauthorized: not authorized on admin to execute command { find: "user", filter: { username: "root" } }"
I followed the illustration of vertx's mongo auth like this:
MongoClient client = MongoClient.createShared(vertx, new JsonObject().put("connection_string", "mongodb://127.0.0.1:27017/admin"), "My ...
5
votes
3
answers
5k
views
MongoDB synchronize Development and Production databases
We have a dev server which contains a collection of Objects.
The actual accumulation of these objects is an ongoing process, which runs a whole process of labelling, verification, etc. on this local ...
1
vote
0
answers
608
views
Mongodb - promoting data from staging to prod environment
I have prod and staging environments for Mongodb. I have good amount of data entered it staging environment for every release which will go through testing process. Once the testing is done, I would ...
12
votes
6
answers
25k
views
Data migration tool for MongoDB [closed]
I'm looking for a data migration tool for MongoDB,
something like Liquibase or Flyway, that is compatible with Mongo 3.0.
Any recommendations?
Thanks.
3
votes
1
answer
92
views
Django Mongodb Backend not creating collections and indexes
Summary
Running Django migrations against our MongoDB database does not create MongoDB collections or indexes as defined in our app. The command completes without errors, but no collections or indexes ...
1
vote
2
answers
620
views
Mongoid Aggregate result into an instance of a rails model
Introduction
Correcting a legacy code, there is an index of object LandingPage where most columns are supposed to be sortable, but aren't. This was mostly corrected, but few columns keep posing me ...
1
vote
1
answer
46
views
Identify records in a.d that do not have corresponding record in a.p in nested array
I need to identify the list of array records a.d[] that do not have duplicate in a.p[]. In the nested object below with a.d.prid:"2" is such an record: it has same pid with a.p[pid] and a.d[...
0
votes
0
answers
283
views
nginx, PHP, session data trouble with server sent event
I'm using several technologies for a web application:
nodejs for socket.io and request
nginx / PHP
server sent event
session store in a mongodb collection.
node/socketio/request: acts as a ...
4
votes
2
answers
83
views
Is MongoDB BSON Timestamp signed or unsigned?
The BSON Timestamp type, documented here https://www.mongodb.com/docs/manual/reference/bson-types/, includes a 32-bit time_t field. Does anyone know whether this field is signed or unsigned? If signed,...
5
votes
3
answers
13k
views
How to re-render component after fetch request and state change?
I'm new to react and tying in the back end but after I make the fetch requests, I have to reload the page to see any changes. The database is updated as soon as the functions are called but the ...
146
votes
6
answers
189k
views
MongoDB not equal to
I'm trying to display a query in MongoDB where a text field is not '' (blank)
{ 'name' : { $not : '' }}
However I get the error invalid use of $not
I've looked over the documentation but the ...
0
votes
0
answers
53
views
Mongock rollback method is not executed
I have a collection migrationTest in MongoDB with a unique index for the message field.
In my migration I'm inserting documents to this collection and in one place I'm using the existing message 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 ...
1
vote
2
answers
2k
views
How to sort a mongodb query result in ascending order of age, without a createdAt field? (new to old)
When you do a mongodb query, you normally get the results in descending order of age(old to new). How can I get it in the ascending order?
I know that I can save the createdAt timestamp and do a .sort(...
1
vote
1
answer
66
views
MEAN Stack - Delay in query and request?
I'm trying to learn Node.js and writing a web app with the MEAN stack.
As I send on an array of strings containing item data (say, ["one", "two", "three"]) to the server ...
1
vote
2
answers
50
views
Laravel + MongoDB: Update nested value in Model
I have Model with a deeply nested attribute:
$model = Model::create();
$model->nested_prop = ['foo' => ['bar' => ['x' => 1]]];
$model->save();
In another method I want to modify a ...
12
votes
5
answers
9k
views
How to calculate the percentile?
I have access logs such as below stored in a mongodb instance:
Time Service Latency
[27/08/2013:11:19:22 +0000] "POST Service A HTTP/1.1" 403
[27/...
2
votes
1
answer
71
views
Should I close the DB connection in NextJS
I am new to programming (and NextJS) and I'm building a NextJS app, using Mongoose for my MongoDb connection. I was wondering if I should close the connection after each query? Right now I am just ...
0
votes
0
answers
57
views
After upgrading mongodb to v5+ getting a "com.mongodb.MongoTimeoutException: Timed out.." in spring boot tests
Disclaimer: There are a couple of questions for this exact exception, sadly none of those match my environment or circumstances (thus i think this question is unique)
In my case i have a:
working ...
1
vote
1
answer
91
views
mongodb delete nested grandchild query in C#
been trying for some time now to run a delete query against a mongodb collection; strongly typed objects, parents, nested children, each with nested grandchildren. i want to delete a specific ...
0
votes
3
answers
108
views
Issue in connecting with MongoDB
I'm having an issue connecting my server to a MongoDB database, I've added the code I used and the error I got below. I've consulted with ChatGPT, and it suggested an SRV DNS resolution issue, but ...