Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rearranging all models #17

Open
Subhash23jan opened this issue May 10, 2024 · 4 comments
Open

Rearranging all models #17

Subhash23jan opened this issue May 10, 2024 · 4 comments
Assignees

Comments

@Subhash23jan
Copy link
Contributor

Subhash23jan commented May 10, 2024

@Trisha-tech
when user deletes, then cart should be deleted, but since user and cart are different collections, we can't do this

we can have order and cart list in the user schema
whenever user deletes, then his order and cart details would be deleted. From this, we can reduce the database storage, it's easy to get details without co mplex queries and we can reduce times as well.
if this idea works for your application
Could you please assign this work?

@Trisha-tech
Copy link
Owner

@Trisha-tech when user deletes, then cart should be deleted, but since user and cart are different collections, we can't do this

we can have order and cart list in the user schema whenever user deletes, then his order and cart details would be deleted. From this, we can reduce the database storage, it's easy to get details without co mplex queries and we can reduce times as well. if this idea works for your application Could you please assign this work?

Hello @Subhash23jan , Go for it
All the best

@SidharthaPaidi
Copy link

SidharthaPaidi commented May 11, 2024

@Trisha-tech when user deletes, then cart should be deleted, but since user and cart are different collections, we can't do this

we can have order and cart list in the user schema whenever user deletes, then his order and cart details would be deleted. From this, we can reduce the database storage, it's easy to get details without co mplex queries and we can reduce times as well. if this idea works for your application Could you please assign this work?

Hello @Subhash23jan , A single document in MongoDB is limited to 16MB. This limit may be reached if a user has a lot of orders or items in their cart, and also You will need to locate and make any necessary updates to each user document that contains an order or cart item, such as when a product's price changes which makes it more complex .

@Trisha-tech We can use this strategy if you are not concerned about these possible problems with your application.

@Trisha-tech
Copy link
Owner

@Trisha-tech when user deletes, then cart should be deleted, but since user and cart are different collections, we can't do this
we can have order and cart list in the user schema whenever user deletes, then his order and cart details would be deleted. From this, we can reduce the database storage, it's easy to get details without co mplex queries and we can reduce times as well. if this idea works for your application Could you please assign this work?

Hello @Subhash23jan , A single document in MongoDB is limited to 16MB. This limit may be reached if a user has a lot of orders or items in their cart, and also You will need to locate and make any necessary updates to each user document that contains an order or cart item, such as when a product's price changes which makes it more complex .

@Trisha-tech We can use this strategy if you are not concerned about these possible problems with your application.

Hello @SidharthaPaidi , Go for it
All the best

@Subhash23jan
Copy link
Contributor Author

Subhash23jan commented May 11, 2024

@Trisha-tech when user deletes, then cart should be deleted, but since user and cart are different collections, we can't do this

we can have order and cart list in the user schema whenever user deletes, his order and cart details would be deleted. From this, we can reduce the database storage, it's easy to get details without co mplex queries and we can reduce times as well. if this idea works for your application, Could you please assign it?

Hello @Subhash23jan , A single document in MongoDB is limited to 16MB. This limit may be reached if a user has a lot of orders or items in their cart, and you will also need to locate and make any necessary updates to each user document that contains an order or cart item, such as when a product's price changes which makes it more complex .

@Trisha-tech We can use this strategy if you are not concerned about these possible problems with your application.

@SidharthaPaidi
each order should be stored with price while saving and it will need lot of rework and i'm working on that. The user will have order id only and order collections will remain the same
currenlty i'm working on that and there are lot of improvements needed for cart as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants