There are a number of text conventions used throughout this book.
CodeInText: Indicates code words in text, database collection and field names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "Finally, the $sort stage reorders the final results by the match field _id (that is, the country code)."
A block of code is set as follows:
db.bookings.aggregate([
{ $match : { "bookingInfo.paymentStatus" : "confirmed" } },
{ $group: { "_id" : "$customer.customerAddr.country",
"total" : { $sum : "$totalPrice" } } },
{ $sort : { "_id" : 1 } }
]);
If a line of code or a command needs to be all on a single line, but the book's page width prevents this, the line will be broken up into two lines. A backslash (\) is placed at the break point. The remainder of the line appears indented on the next line as follows:
this.command('has', 'many', 'arguments', 'and', \
'would', 'occupy', 'a', 'single', 'line')
Any command-line input or output is written as follows:
cd /path/to/repo
docker-compose build
docker-compose up -d
docker exec -it learn-mongo-server-1 /bin/bash
Bold: Indicates a new term, an important word, or words that you see onscreen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "You can also select Fill in connection fields individually, in which case these are the two tab screens you can use."