In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.
Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "We can store the relationship in the Group
document."
A block of code is set as follows:
collection.update({resource: resource, date: today}, {$inc : {daily: 1}}, {upsert: true}, function(error, result){ assert.equal(error, null); assert.equal(1, result.result.n); console.log("Daily Hit logged"); callback(result); });
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
var logMinuteHit = function(db, resource, callback) { // Get the events collection var collection = db.collection('events'), // Get current minute to update var currentDate = new Date(); var minute = currentDate.getMinutes(); var hour = currentDate.getHours(); // We calculate the minute of the day var minuteOfDay = minute + (hour * 60); var minuteField = util.format('minute.%s', minuteOfDay);
Any command-line input or output is written as follows:
db.customers.find( {"username": "johnclay"}, {_id: 1, username: 1, details: 1} )
New terms and important words are shown in bold.
3.143.255.36