All Questions
Tagged with database-design mongodb
736 questions
-2
votes
1
answer
72
views
Scalable Database Design [closed]
I am creating a website, and this is the database I have designed. I have created this design in such a way that it scales well in the long term. The following features are supported by my database:
...
0
votes
1
answer
100
views
MongoDB best practices for many sensors (+50k) but slow updates (every 12hrs)
I am trying to get some advice on how to appropriately structure my MongoDB Database. I am on Mongo Atlas M10 and my data structure looks like this:
{
sensorId: "12345",
epoch: Date,
...
1
vote
1
answer
801
views
Struggling with Prisma schema setup for many-to-many relationships on MongoDB
I'm trying to create schemas using PrismaORM with MongoDB, and I'm facing an issue with establishing a many-to-many relationship between User and Post models. My goal is to establish a relation ...
0
votes
1
answer
256
views
Explicit many-to-many relation Prisma schema syntax for MongoDB
The following is my Prisma Schema for 3 models --> User, Cart and Item.
model User {
id String @id @default(auto()) @map("_id") @db.ObjectId
name String
email ...
1
vote
0
answers
58
views
Best Practices for Efficiently Writing Time Series Data to MongoDB Collections with Dynamic Variables
I am currently working on a project involving MongoDB with three collections: datasources, variables, and a time series collection values. The values collection stores time-stamped data for various ...
1
vote
0
answers
27
views
How do I go about replicating the "opened/unopened" system of your phones "mail" app in a NodeJS + MongoDB application?
The app we are dealing with:
Imagine a NodeJS e-commerce app where you can purchase items, and user orders are stored in MongoDB.
Imagine the app has an admin dashboard where all orders are listed in ...
0
votes
0
answers
90
views
Mongodb transaction if document has multiple copies
Consider I have a document A in the MongoDB database with multiple copies (as it is a distributed db, partition P1 and P2 has same entry A)
Given there is single document transaction in Mongo, if I ...
-1
votes
1
answer
125
views
Can you use a MongoDB document ID as a key in another document?
I'm trying to implement a cart collection for an e-commerce app in MongoDB Atlas and am unsure of the correct way to reference the products in a user's cart which are in a separate collection.
Can I ...
-2
votes
1
answer
188
views
Is it a good idea to store chat records in MongoDB's collection?
I am writing a chat software with ChatGPT, and I want to save the user's chat records with ChatGPT to the MongoDB collection. I need 2 functions to:
List the id, createTime, and cost of all chat ...
-1
votes
1
answer
50
views
How to find missing inter-relationships in a family if I have one element mapping to all others. How to store relationship among each other?
I have to design an application where users have their family members, with their relationship among them denoted in the app. If I log in as father in my app, I see my son name and relationship ...
0
votes
1
answer
33
views
How do a create an array subdocument that references "guests" from another model at a future date?
I have an events model where guests can "signup" and join the event. Each event is a contest so it has a max amount of "guests" for each as certain slots are labeled as "...
-2
votes
1
answer
24
views
Probleme schema Design mongodb nodejs mongoos
Im trying to create a knew schema mongodb like this :
`const badgeSchema = new Schema({
emt: { type: String, required: true },
modele: { type: String, required: true },
code: { type: String,...
0
votes
0
answers
54
views
Storing iot data in mongodb using nodejs after batching the data
I want to store my iot data in mongodb, currently I have over 300 iot devices sending data in every 15 seconds.
My DB schema for the same is :-
A DEVICE COLLECTION:
_id : ObjectId()
name: String
...
0
votes
0
answers
547
views
How to handle likes and dislikes in application with API
I have a Nextjs application with Prisma and Mongodb. Users can like/dislike posts on their feeds.
It works pretty well, but the problem is when the post is liked by the user, then he dislikes and ...
0
votes
2
answers
874
views
Getting slow query with high schemaLock time
I am working on a project, in which I have used mongoDb as database.
I am working on the cron, in which there was high mongoDb input/output operations, i.e. there was around 10k/s i/o operations on ...