MongoDB Applied Design Patterns

Errata for MongoDB Applied Design Patterns

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".

The following errata were submitted by our customers and approved as valid errors by the author or editor.

Color Key: Serious Technical Mistake Minor Technical Mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted By Date Submitted Date Corrected
Printed, PDF, ePub
Page 21
2nd code snippet - add_short_descriptions method

The example shows an error as to make the search of documents with the $in operator on the _id field, the passed argument is not a list of ObjectId: def add_short_descriptions(): node_ids_to_migrate = db.nodes.find( {'short_description': {'$exists':False}}).limit(100) db.nodes.update( { '_id': {'$in': node_ids_to_migrate } }, { '$set': { 'short_description': '' } }, multi=True) A list comprehension is suggested: def add_short_descriptions(): selected_nodes = db.nodes.find( {'short_description': {'$exists':False}}).limit(100) node_ids_to_migrate = [n['_id'] for n in selected_nodes] db.nodes.update( { '_id': {'$in': node_ids_to_migrate } }, { '$set': { 'short_description': '' } }, multi=True)

Note from the Author or Editor:
Absolutely correct -- the submitter's code example should replace the code example in the book.

Jorge Puente SarrĂ­n  Jun 25, 2013 
Page 135
example code in "Commenting on a Post"

strfime -> strftime missing "t". Also, this can be seen in page 137.

Note from the Author or Editor:
These should both indeed be spelled 'strftime'

iwanaga  May 24, 2013