Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.

Questions tagged [mongodb]

MongoDB is a scalable, high-performance, open source, document-oriented database. It supports a large number of languages and application development platforms.

Filter by
Sorted by
Tagged with
1 vote
0 answers
29 views

I was facing an issue with changing models on the fly — since we don’t just need isolation based on string or ID, but also data-level differences for each HIMS instance. To handle this, I created a ...
Owais Qureshi's user avatar
0 votes
0 answers
8 views

Title: Code Review Request: Mongoose Soft Delete Plugin with Query & Aggregate Middleware Body: I’ve implemented a soft delete plugin for Mongoose to handle REST API data safely in a MENN stack ...
Owais Qureshi's user avatar
5 votes
1 answer
374 views

I think I cooked again, but maybe not. I'll share with you the product of today's cooking: ...
Luca Bonaldo's user avatar
1 vote
0 answers
64 views

Using the server architecture to provide a REST interface. So I can send/recieve JSON that is put/retrieved from a mongo server. The Fir class MongoRest is similar ...
Loki Astari's user avatar
  • 97.7k
3 votes
0 answers
53 views

This update is based on a previous review where I tried creating a WriteConfig and a WriteConfigBuilder. I have updated this so ...
Loki Astari's user avatar
  • 97.7k
5 votes
1 answer
234 views

The mongo API uses documents (encoded in BSON) as the way to perform queryies (for find / remove etc). For example a query to find all record where the name field ...
Loki Astari's user avatar
  • 97.7k
2 votes
0 answers
40 views

Refactored part of the original code: c++ Mongo Interface Implementation of ScramSha-256 for Mongo server to be used with the Authenticate class. Example of Usage: ...
Loki Astari's user avatar
  • 97.7k
2 votes
1 answer
68 views

Refactored part of the original code: c++ Mongo Interface This review is looking only at the "Op_MSG()" functions. These functions are used to read/write standard C++ objects to Mongo. The C+...
Loki Astari's user avatar
  • 97.7k
4 votes
1 answer
120 views

This questions needs some set up. I have some code that serializes C++ objects into JSON/YAML/BSON. Code here review here. Simply you can serialize and de-serialize C++ objects to a ...
Loki Astari's user avatar
  • 97.7k
4 votes
2 answers
271 views

What are the best practices for connecting to a database in FastAPI? To provide some context, I want to write code to connect to a MongoDB database using Motor. My idea is to create a single ...
Heber Alturria's user avatar
2 votes
1 answer
59 views

i'm trying to learn backend with Next JS, and i'm using Prisma + MongoDB. I want to create a simple website with a user with a cart and some products. here my schema : ...
Jonathan's user avatar
0 votes
1 answer
103 views

I have used this approach in my Golang MongoDB REST APIs' DAO layer, I need to clarify whether this is a good way or not, code is as follows, ...
Nisal Edu's user avatar
  • 103
1 vote
1 answer
134 views

I am writing a resolver for a typical updateUser mutation with node, Apollo Server and mongoDB. I want to make it such that, when the ...
user8758206's user avatar
1 vote
1 answer
106 views

I have a method that on click produces an excel file with information in it. I have been asked to pull images from the data base and add them within the excel file as well. This is how I am pulling ...
Adil15's user avatar
  • 163
2 votes
2 answers
158 views

I'm using fiber and mongodb. Field "field" is needed to obtain certain data to unload the load on the database. If field "field" is empty, then needs to output all the data from ...
Boro8ey's user avatar
  • 23
2 votes
1 answer
137 views

I am building a basic authentication system with a node backend and wonder whether I am using the try-catch block excessively. I have this example controller: ...
user8758206's user avatar
2 votes
1 answer
1k views

I'm working on a new project with go. So I figured I would give this new feature a run (it's fun!). Although, I'm not sure I'm implementing this the way it's suposed to be. I've read the following ...
Russo's user avatar
  • 123
1 vote
0 answers
117 views

I have this Whatsapp bot made using Twilio and persistent with mongodb due to the nature of the logic I am following the code is become more of a cluttered and seems un-pythonic. It works fine as I ...
zerox's user avatar
  • 11
0 votes
1 answer
1k views

Created a MongoDB client which is handling the retry in case of server connection failure. Please review and how I can improve further. ...
Srikanth's user avatar
  • 135
1 vote
1 answer
123 views

I'm just getting to know the possibilities of Kotlin and mongoDB. I am writing a method that returns the name of the street after the ID. Everything works, but I find it quite sloppy. Empty String ...
AdamK's user avatar
  • 35
1 vote
1 answer
137 views

I have a python script to archive some data (export from mongo to a local json file and then upload it to s3) Is there a better way to implement/improve the current flow? Each step should be be ...
KeykoYume's user avatar
  • 203
2 votes
2 answers
110 views

This code is from my blog project. This project is almost done. This is working well. I can create new posts and update and display all saved posts. ...
Bhaskar's user avatar
  • 123
4 votes
2 answers
1k views

I'm still in the process of learning Java / spring and I think I'm getting better. Now at this point I'm able to build a rest api BUT I'm at a lost at how to ensure I've no concurrency issues . I've ...
MetaCoder's user avatar
  • 143
1 vote
0 answers
153 views

I wrote below piece of code generating dummy data loaded to MongoDB. 2 issues : 1.customer class has subscriber class so it nested with one level customer--> subsciber. I think i'm not doing right: ...
AviC's user avatar
  • 111
0 votes
1 answer
681 views

Here is my code which will read XML files and import the data to MongoDb. Do you have any comments on my code? ...
Steve Ngai's user avatar
4 votes
1 answer
320 views

Context As many of you may know I have a library that allows C++ objects to be converted into JSON/YAML/BSON automatically with a single declaration (see previous code reviews). I am now (trying) ...
Loki Astari's user avatar
  • 97.7k
2 votes
1 answer
412 views

Simple code for getting documents that have a creationDate between two values in mongodb. If the user provides only one of the values the code should still work and ...
ATheCoder's user avatar
  • 123
3 votes
0 answers
217 views

I wrote a Java Spring Boot application with MongoDB that on every application start loads customer, account type and transaction details from CSV files to MongoDB. It has one end point that returns ...
user232946's user avatar
5 votes
1 answer
209 views

I have put together a blogging application with Express, EJS and MongoDB. There is a public, front-end part and a dashboard. In index.js I have: ...
Razvan Zamfir's user avatar
2 votes
0 answers
760 views

So I wrote a a RESTfull api for a mongodb with python3.7, fastapi and mongoengine and id love to get feedback on how I should make my code more readable, clean, and dry. basically there are 4 main ...
amos-baron's user avatar
1 vote
1 answer
176 views

I'm practicing back-end programming and NodeJS. As an exercise, I'm attempting to build a REST API for a MongoDB collection. I'm also learning to use the Express and Mongoose middle-wares, so that's ...
NPN328's user avatar
  • 791
2 votes
1 answer
146 views

I recently interviewed for a backend developer role at a startup involved in financial products, as a 2020 grad. The take-home assignment they had me submit had a few basic goals and they recommended ...
Utkarsh Pant's user avatar
6 votes
1 answer
92 views

I'm currently building an application using Passport and bcrypt for user authentication. I've created the registration part. Is there anything I could improve on? I'm still getting the hang of writing ...
imnewhere's user avatar
2 votes
0 answers
274 views

I'm writing a simple REST API to my MongoDB using PyMongo (Python 3.7). Each collection I have in the DB has a route (e.g http://the.api.url/collection_name ), and every document under that collection ...
amos-baron's user avatar
3 votes
1 answer
226 views

This has been my approach for "simplifying" MongoDB aggregation queries in a pythonic syntax - was my intent, at the very least: ...
Rfroes87's user avatar
  • 133
4 votes
2 answers
278 views

I wrote a class for some MongoDB operations. So far I'm self-taught and mostly I follow the style from already existing code at my workplace (a startup). We don't have a code-review culture, so I'm ...
Vaibhav yB Shah's user avatar
2 votes
0 answers
93 views

It's the first time a write a non-trivial mongodb query, and I came up with one that does work, but is 123 lines long! Surely there must be a way to write it in a more concise way. The purpose of the ...
user000001's user avatar
3 votes
2 answers
126 views

I'm building a platform like Rundeck/AWX but for server reliability testing. People could log into a web interface upload scripts, run them on servers and get statistics on them ( failure / success). ...
amos-baron's user avatar
4 votes
1 answer
5k views

After some time poorly designing my web applications' backends (mixing database calls with the controller, etc.), I have decided to try the "Clean Architecture" approach. In this example I have a ...
kibe's user avatar
  • 277
4 votes
3 answers
245 views

I have this script which works perfectly but I experienced some delays because of these 2 for loops [i][j]. Is there any way to ...
Nodegeek's user avatar
  • 151
2 votes
1 answer
1k views

I am currently working with the Stack Exchange Data Dump - to be more precise - with the dumped Posts.xml data set from Stack Overflow. What am I trying to achieve?...
djozefiak's user avatar
2 votes
0 answers
133 views

I'm in the process of creating my first web app using node with mongodb on the backend. I could use some opinions on the schemas/models I've set up. I have three schemas: User, Pet, Food. Here's the ...
pfinferno's user avatar
  • 447
1 vote
1 answer
3k views

I am building an API server in golang with mongodb. My main.go file looks something like this: ...
Santosh Kumar's user avatar
3 votes
1 answer
99 views

How would I go about making this script much faster? Essentially it reads from a file and the slowest part is populating the words. In the words file there are over 100k words and I was looking for a ...
Menace's user avatar
  • 293
3 votes
0 answers
434 views

I'm looking for a review of my backend code on how to keep it more DRY. I see a lot of repetition in validation part of email and password, also I need some advice on if I have used the try-catch and ...
ubuntu7788's user avatar
3 votes
1 answer
3k views

I'm learning how to use Kafka, I've never used something similar in the past. In my job I was required to create a POC using it and integrate it to Spring Boot and save information on MongoDB (because ...
Frakcool's user avatar
  • 191
2 votes
0 answers
47 views

I want to represent components of LXC in django; so I defined them in models: Container, Network, Profile and Devices where each one of them have a set of attributs, but when it comes to representing ...
Knox Root's user avatar
1 vote
1 answer
60 views

In an api I'm building, I have multiple routes that require an agency to exist before any action is performed on the requested agency. To avoid repetition I've written some middleware to check that ...
mrmadhat's user avatar
  • 168
2 votes
0 answers
132 views

I'm working on an AWS lambda function that take data from two mongodb databases, find the matching records between two collections by 'id' and calculate each record commission by fixed rate. Then ...
khanhdn's user avatar
  • 21
3 votes
0 answers
231 views

In my endeavor to learn Angular, I've created a flashcard site with an F#/Mongo backend. As I'm new to Angular, I'm going to post everything; any and all feedback is welcome. First, some pictures of ...
user avatar