As seen with Book Someplace, Inc., we break down each collection document structure into a series of smaller classes. Accordingly, the following data structures are exactly as shown in Chapter 7, Advanced MongoDB Data Design:
- Name
- Location
- Contact
- OtherContact
- OtherInfo
- LoginInfo
If you would like to review the complete data structures for these classes, please refer to /path/to/repo/chapters/07/document_structure_definitions.js.
The BigLittle user collection document structure includes a userType field that identifies whether the user is a borrower or a lender. Further, these two identifiers are present in the common collection under the userType key to maintain uniformity. Here is the formal JSON data structure for the user collection:
User = {
"userKey" : <string>,
"userType" : Common::userType,
"amountDue" : <NumberDecimal>,
"amountPaid" : <NumberDecimal>,
...