Each collection features a unique identifying key that's based on an arbitrary algorithm. In this case, the customerKey field includes the first four letters of the first name, the first four letters of the last name, and a phone number. This gives us an alternative way to uniquely identify a customer over and above the autogenerated MongoDB ObjectId property.
In addition, we'll leverage the following previously defined subclasses: Name, Location, Contact, OtherContact, OtherInfo, and LoginInfo. In addition, totalBooked and discount are defined to support the loyalty program. Here is the final collection structure:
Customer = {
"customerKey" : <string>,
"name" : <Name>,
"address" : <Location>,
"contact" : <Contact>,
"otherContact" : <OtherContact>,
"otherInfo" : <OtherInfo>,
"login"...