Skip to main content

All 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: ...
coder25's user avatar
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, ...
Hyun Seo's user avatar
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 ...
Gulam Mustafa's user avatar
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 ...
Harsingh Sekhon's user avatar
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 ...
anonymous_33008899's user avatar
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 ...
Oscar's user avatar
  • 590
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 ...
System Designer's user avatar
-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 ...
Sylith's user avatar
  • 709
-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 ...
FengZi's user avatar
  • 91
-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 ...
user19742850's user avatar
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 "...
econobro's user avatar
  • 369
-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,...
Amine Gabsi's user avatar
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 ...
anonymous_33008899's user avatar
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 ...
gitaan's user avatar
  • 9
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 ...
sahil garg's user avatar

15 30 50 per page
1
2 3 4 5
50