Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Help with Shopping Cart Schema in mongoDB, calculating the sum of the cart in the Cart Schema

I have been attempting several different methods to calculate the sum of the user shopping cart.

My code and question is here, in a second I will make a work space for a couple files. http://stackoverflow.com/questions/37931062/getting-the-sum-of-a-shopping-cart-in-mongodb

I am making a mean stack, Amazon style web application and I need the cart calculated inside my schema. Either with a set: function or arrogation using $group $sum, or anything, I just need an example.

https://teamtreehouse.com/workspaces/18463802

my api populates the cart product by using the ID to grab the data from product model.

i just now need the data for totals populated

Steven Parker
Steven Parker
243,318 Points

:x: You can't share a direct URL to your workspace, it's temporary and only exists while you are using it.
:information_source: But you can use the snapshot function in the workspace and provide the link to that.

1 Answer

Ken Alger
STAFF
Ken Alger
Treehouse Teacher

Daniel;

Did you get this resolved?

Ken