Data modeling

Now that we have a high-level view of our architecture, let's define our models and see how they interact. This will give you a high-level view of how you are going to store your data in the database. Also, it will reflect the connections between different entities and you can decide, in the case of MongoDB, what documents will be embedded and which ones will be referenced.

Custom money data type

In the earlier Expense Tracker application, we concluded that there is a way to work with monetary data in JavaScript and MongoDB. It only needs extra application logic to handle the Exact Precision solution.

Because we are working with Mongoose as our ODM for Mongo, we can define a custom model for monetary data. I know it sounds strange, ...

Get Web Application Development with MEAN now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.