Management has asked you to create a financial report that provides a summary of revenue generated by users with Facebook accounts. Looking at the structure of documents in the booksomeplace.bookings collection, you note that the Facebook page for customers is contained within a socialMedia array, which itself is contained in an embedded document, customerContact. You further note that information in the socialMedia array is keyed according to the social media type.
The MongoDB internal document representation closely follows JSON syntax. Accordingly, there are no object class types assigned when the document is stored in the database. You can access object properties by simply appending a dot (.) after the field that references the object. So, in our example, the customerContact field represents a Contact object. It, in turn, is nested in the field referenced by customer. In order to reference information...