Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
50 views

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

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

exports.getAllProducts = async (req, res) => { try { console.log(req.query); const queryObj = { ...req.query }; const excludedFilters = ["page", "limit", "...
0 votes
0 answers
71 views

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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 ...