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. Questions about administrating it can be asked on dba.stackexchange.com

Filter by
Sorted by
Tagged with
-1 votes
1 answer
48 views

Implementing a selectable requirements with level of advancement in a web app [closed]

I'm doing a project to teach myself more about MongoDB and ASP.NET development and I am stuck. The project is a mockup of a JobBoard website, where Companies would post offers for potential Employees. ...
AdrianIT's user avatar
1 vote
4 answers
692 views

Microservices distributed lock mechanism

I am using spring boot with mongo db (azure cosmos db) in my microservices. Currently I have an Orders collection that stores Orders. These documents have a field userId that is null when the document ...
Andre Silva's user avatar
0 votes
1 answer
311 views

Business Rule Engine - Postgresql [closed]

Our organization is into Health Care RCM business. In that, we use to receive medical records (called as accounts, which is a business phrase) and our staff (Medical coders) use to do medical coding, ...
Senthil's user avatar
  • 13
1 vote
0 answers
28 views

Optimised MongoDB design for access control at project/organisation level

I'm looking for the optimised approach of designing MongoDB database collections where there are three stakeholders- A User (who accesses a portal). An Organization (which can have multiple Projects)....
Shashank Agrawal's user avatar
1 vote
2 answers
2k views

When to use an array of objects or an object of objects in MongoDB Design?

I have a question about the general guidance of how to properly mongodb design: Scenario: I have many collection of objects, all uniquely identified by their contract_address, and i want to be able to ...
Askar's user avatar
  • 13
1 vote
1 answer
95 views

Aggregating embedded documents in MongoDB

I'm designing a mongo database and I have a dilemma if I should go for normalization. Let's say that there is a database with images and descriptions. Many alternative descriptions can belong to one ...
Karol Borkowski's user avatar
2 votes
1 answer
1k views

How to scale transactional outbox pattern with document database?

I'm trying to understand CQRS, DDD by writing a small pet project which is somewhat similar to this great repo. I've come across Transactional Outbox pattern and as imo it was correctly pointed out in ...
gasabr's user avatar
  • 41
1 vote
1 answer
1k views

Difference between Resolvers and Controllers?

I may be overthinking it, but are controllers and resolvers the same thing in web applications? Coming from the MERN stack, everyone used to call these request processing functions "controllers,&...
twominds's user avatar
  • 129
0 votes
1 answer
136 views

Mixing static referred and dynamic data in database

I’m making an inventory for a game using nosql (mongo). I made some ItemType records (contains common data like icon, name, weight) and some ItemInstance records (representing specific items, ...
Bohdan Bessonov's user avatar
0 votes
1 answer
105 views

What's the difference between MongoDB Query API and MondoDB Query Language?

So I've been trying to understand the difference between MongoDB's Query API and its Query Language but I haven't been able to find a definitive answer. I've been reading the MongoDB Docs and it is ...
Nikitas IO's user avatar
1 vote
1 answer
271 views

How to represent NoSQL entities

I've mainly studied SQL structures, and I know that the representation of the entities can look something like this: However, I'm building this app with MongoDB, so NoSQL DB. I'm aware that MongoDB ...
fel.jim's user avatar
  • 13
0 votes
1 answer
362 views

Store UUID Reference vs. storing string in Mongodb

I am trying to store user preference for notifications. One way to do is store types of notification in separate collection and store UUID of that notification type in user table. e.g. notification-...
Anonymous Creator's user avatar
-3 votes
1 answer
129 views

Ways & Methods switch between MongoDB Database after selecting a country. (MERNG)

I have a concept in which a user selects a country, which will either filter or go to that database; I was thinking of alternatives or options that would help in the process. These are my first plans ...
Mohammad Khan's user avatar
0 votes
0 answers
43 views

Query for each doucment or include IDs in document itself and query for all documents with ID?

I am working on a project where there will be different kinds of accounts that use Auth0 for auth and authz. I want to have it so that an account will query my backend to get back documents that ...
joshk132's user avatar
  • 161
0 votes
1 answer
106 views

Right way to combine data between Mongo and DynamoDB

I am looking for a way of dealing with the following situation: 1- Have an items collection in MongoDB 2- Have a users collection in DynamoDB 3- Each document in the items collection has a "...
alvm's user avatar
  • 3
2 votes
2 answers
1k views

What is the advantage of Kafka connector to MongoDB over using MongoDB change streams?

I need to stream changes from my MongoDB instance to Elasticsearch. I also need to perform complex transformations on changed documents. After doing some research I narrowed my options down to 2: ...
Yos's user avatar
  • 155
0 votes
0 answers
83 views

Storing common data across tenants in NoSQL databases like mongoDB

We are designing a multi-tenant architecture. In our multi-tenant architecture, there are different email templates that are shared across all the tenants. Email template looks like subject: {...
Paramjeet Desai's user avatar
0 votes
2 answers
225 views

Saving & Referencing different Schema Types in MongoDB (e.g. for a CMS with Building Blocks)

Say I wanted to build my own CMS system and store data in MongoDB. I would like to have a Collection called BlogArticle. Each article can have a different structure, but will be put together by the ...
antonwilhelm's user avatar
-2 votes
2 answers
947 views

How to best manage multilingual information in documents in JSON/MongoDB/Mongoose?

I have to manage multilingual information in JSON documents in a MongoDB/Mongoose context. But I'm in a dilemma regarding best the format to use with a view to performance metrics: I'm currently ...
The Neighbors Kid's user avatar
-3 votes
1 answer
108 views

How do I evaluate if a data warehouse is necessary?

I need to put data from MongoDB together with tracking data from a quiz app (stuff like which users clicked what button etc). Then I’ll use this in machine learning. I looked at all the DW options ...
a0142204's user avatar
0 votes
0 answers
62 views

Redis or MongoDB in Memory

I am working on processing of documents and storing their hash in Redis to identify duplicate records and some system files. Recently we migrated to MongoDB from SQL Server as our primary database. So ...
Anonymous Creator's user avatar
1 vote
5 answers
278 views

OOP applications and Databases

I am having such a hard time with OOP and databases. Both in C++ with SQL and even more so with Node.js and MongoDB. For this question I will use Node/Mongo. Let's say we have a user object. Over time ...
allthewayaround's user avatar
0 votes
1 answer
455 views

Spring Boot + MongoDB project structure and database creation

I'm planning to start a new Spring Boot project with MongoDB. I'm very familiar with Spring Boot, but all of my past projects used MySQL. Each of my projects has the following directory, that holds ...
Maroun's user avatar
  • 103
-2 votes
2 answers
309 views

What's better, using DB or Storage services to save videos?

I am creating a website that allows to teachers to uploading courses, what's better, to just use the DB or should I use storage services, and how could I know the size of the videos? I am using AWS if ...
Elzubair Mohammed's user avatar
2 votes
1 answer
58 views

Need advice on approach for IOT project

I need some advice on an IOT project I am working on. Here are some details about what I am trying to do: Use Case: Periodically receive data from the 3rd party vendor API in real time and allow users ...
Riley MacDonald's user avatar
0 votes
0 answers
271 views

Storing tree data in a database for fast reading of the whole hierarchy

I have a class that looks something like this: class Entity { public string Id { get; set; } public List<Entity> Children { get; set; } public void DoStuff(Data data) { ...
rytisk's user avatar
  • 109
1 vote
3 answers
166 views

Which of these model error handling strategies makes most sense?

I am building an API in expressjs and, currently, mongo/mongoose. I currently have some model methods that return true or false, some that return a value or false, and some that return a value or ...
Roger Heathcote's user avatar
2 votes
1 answer
117 views

eCommerce category path - names vs IDs

I am building an eCommerce website and there is a Category table in my MongoDB database which has a field called path. This field is used to store category hierarchy e.g Boots category will have /...
Irfan's user avatar
  • 129
0 votes
1 answer
54 views

System design to store pieces of data with specific ttyl to then refetch

I have a system which generates pieces of data that needs to be tracked and assigned a specific TTYL value (a value in seconds) for how long they are supposed to live before being re-processed. I ...
user391986's user avatar
1 vote
0 answers
50 views

Stuck on approach on how to serve a lot of data to users with a lot of possible combinations

So, I'm making an application which monitors specific things that happen within the area of a user. And I'm really stuck at the approach on how to serve specific real-time data to my users. I am using ...
Thimma's user avatar
  • 119
0 votes
1 answer
55 views

What is the schema to specify relationships in a flat-document structure?

I have a question about the best database schema to do this. So, we want our database schema to carry out some generic operation <> involving two units of data, x1 and x2 (e.g. a1). // CURRENT ...
tintinthong's user avatar
2 votes
2 answers
581 views

Isn't data migration a major benefit of MongoDB compared to the commonly used relational databases?

I was reading an old answer which was recently updated, and noticed that the author doesn't quote the simplicity of data migration as a benefit of MongoDB. I always thought that the major benefit of a ...
Arseni Mourzenko's user avatar
0 votes
0 answers
39 views

Filtering data from elastic search based on mongodb

I've a list of items in my ElasticSearch. User enters a query and I fetch the results from elastic search. Now, I've a requirement where I don't want to show the user the items which he has already ...
Avi Yadav's user avatar
3 votes
3 answers
1k views

Is it necessary to run tests in all environments?

In our project, we have DEV, STG and PRD environments that are configured to mirror each other (especially STG and PRD). We have unit tests that we run on DEV and, if they pass, are moved to STG when ...
OneSource's user avatar
  • 199
1 vote
2 answers
205 views

Ease testing with complex setup scenarios

Within our codebase we have integration tests like these: func TestActivateSuspendedFoo() { // setup all dependencies baz := jsonToStruct( "baz": { "a": ...
Filipe Gorges Reuwsaat's user avatar
-3 votes
1 answer
88 views

Do I need MongoDB (or another type of database) to authenticate with Google?

I'm creating a web application using Node.js and Pug, and have recently been looking at adding external OAuth authentication to this site, using Express and Passport.js. I've found a lot of examples ...
JackLidge's user avatar
  • 113
0 votes
0 answers
188 views

Creating group/application/user permissions around mongodb documents

I'm trying to find a good way to manage permissions for a high number of mongo documents. What I want to do: Apply group/user/and or application permissions to mongo documents. Idea 1: Use mysql to ...
daynok's user avatar
  • 1
1 vote
0 answers
191 views

Combine/Sync Amazon S3 and MongoDB Atlas with Elastic Search

I have many continuously growing (through scrapping) collections in MongoDB Atlas. The documents in each collection follows the following schema: { "source_url": "<some url on the web>", "html":...
inquilabee's user avatar
3 votes
1 answer
528 views

What *really* is the difference between relational and non-relational data?

Here is where I am at right now: I know that relational data, like that found in relational databases like MySQL or Postgres, is relational because there are relations between the tables. That is the ...
IchBinGrumpig's user avatar
3 votes
1 answer
108 views

Storing username and password for another site in Node and MongoDB

This is not about storing my user's login details in the app, I already use hash and JWT tokens for that. There is a part of our app where we need to store the login details of the user for another ...
AlexanderKaran's user avatar
1 vote
0 answers
5k views

Spring Data MongoDB: Update document based on multiple identifiers with Composite ID vs. MongoTemplate upsert vs. MongoRepository find & save

I'm wondering for best practices to upsert a document based on two identifiers. @Document(collection = "cars") public class CarEntity { @Id private ObjectId id; private String ...
Bennett Dams's user avatar
0 votes
1 answer
193 views

How can I store time series data like Google Analytics, Facebook, etc?

I'm thinking about this in terms of a No SQL database, more specifically MongoDB. So, I want to build something like Google Analytics where I will be taking in a ton of data and when it occurs so I ...
WildWombat's user avatar
-1 votes
1 answer
378 views

How to store nested data in efficient way in DB

We have daily 200-300 live projects which receive online traffic from our vendors across all our live projects. We store this data in two different DB (I know this sounds bad, but seemed good at the ...
Pankaj Jha's user avatar
-3 votes
2 answers
88 views

How to scale an application where every read results in a write?

So I am trying to design a simple URL shortener application where every time a URL is queried, it is going to update the number of times it has been queried. I'm thinking of using MongoDB and I am ...
Auro's user avatar
  • 291
0 votes
0 answers
36 views

Recommendations for data clustering in an application

I am making a social media app. I have a use case in which i have to cluster similar type of data. For example, take Instagram. When a user likes a post, we get a notification that 'x likes your post'...
Gabriel's user avatar
1 vote
2 answers
273 views

Dealing with complex uniqueness in MongoDB

I am creating a booking system that will allow users to make a reservations for whole days. When a user wants to initially make a reservation, they select the day(s) and then will have 10 minutes to ...
Matthew Weeks's user avatar
1 vote
2 answers
3k views

Bidirectional sync between two databases with differing schemas

I'm embarking upon a project where the goal is to create a bidirectional sync mechanism between two database systems with differing schemas. One is a custom CRM app build on MongoDB, the other is ...
Journeyman's user avatar
0 votes
0 answers
298 views

Sorting and filtering: ElasticSearch vs MongoDB

This is a problem related to a typical e-commerce requirement. I am using ElasticSearch for all the below use cases. I am confused about whether or not to use MongoDB for the sorting part. I have the ...
rohanagarwal's user avatar
3 votes
1 answer
492 views

Is it recommended to use schemas on non-relational databases?

I'm trying to figure out if the use of schemas on non-relational schemaless databases like MongoDB is a recommended practice or a bad practice to be avoided. I am doing research work and am looking ...
Javier Scars's user avatar
-2 votes
1 answer
91 views

How to safe Consistency in DDD project in single aplication?

I want to design my project in DDD spirit. This is single aplication (not microservices) but with separate BC (as modules). Each BC have separate mongoDB collection. I have problem with communication ...
Octopusek's user avatar