The following errata will be fixed in the second printing of the book.
-
Page xvii, Acknowledgments, third paragraph
"Kristina Chowdorow" should be "Kristina Chodorow". My apologies to Kristina!
-
Page 11, Transaction logging sidebar
"random I/O is much slower that sequential I/O" should read "random I/O is much slower than sequential I/O"
-
Page 16, Final sentence under "Command-line tools"
monfile should read mongofiles
-
Page 21, Final paragraph before 1.5, last sentence
"may greatly simply" should read "may greatly simplify"
-
Page 21, Footnote 12
The <code> tags should not be visible.
-
Page 39, Code snippet before 3.1.2
$ruby connect.rb
should read
$ ruby connect.rb
-
Page 39, Code snippet at the bottom of the page
$ irb -r connect.rb
should read
$ irb -r ./connect.rb
-
Page 45, The title in Figure 3.2
"_id" => ObjectId('4c2a...')
should read
"_id" => BSON::ObjectId('4c2a...')
-
Page 45, Figure 3.2
The document length should be little-endian (38 0 0 0).
Each fields last byte should be understood as a null terminator: '\0'.
-
Page 48, Code snippet
def save_tweets_for(term)
Twitter::Search.new.containing(term).each do |tweet|
@tweets_found += 1
tweet_with_tag = tweet.to_hash.merge!({"tags" => [term]})
@tweets.save(tweet_with_tag)
end
end
should read
def save_tweets_for(term)
Twitter.search(term).each do |tweet|
@tweets_found += 1
tweet_with_tag = tweet.to_hash.merge!({"tags" => [term]})
@tweets.save(tweet_with_tag)
end
end
-
Page 48, Listing 3.1
require 'config'
should read
require File.join(File.dirname(__FILE__), 'config')
-
Page 49, First code snippet
Replace
def save_tweets_for(term)
Twitter::Search.new.containing(term).each do |tweet|
@tweets_found += 1
tweet_with_tag = tweet.to_hash.merge!({"tags" => [term]})
@tweets.save(tweet_with_tag)
end
end
with
def save_tweets_for(term)
Twitter.search(term).each do |tweet|
@tweets_found += 1
tweet_with_tag = tweet.to_hash.merge!({"tags" => [term]})
@tweets.save(tweet_with_tag)
end
end
-
Page 49, Second code snippet
Replace
require 'config'
require 'archiver'
with
require File.join(File.dirname(__FILE__), 'config')
require File.join(File.dirname(__FILE__), 'archiver')
-
Page 49, Third code snippet
ruby update.rb
should read
$ ruby update.rb
-
Page 50, Listing 3.2
Replace
require 'config'
with
require File.join(File.dirname(__FILE__), 'config')
-
Page 69, First and second paragraphs
"Next, you insert 20..." should read "Next, you insert 40..."
"Even though you've inserted 20..." should read
"Even though you've inserted 40..."
-
Page 78, Final code snippet
Replace
category = db.categories.findOne({'slug': 'outdoors'})
siblings = db.categories.find({'parent_id': category['_id']})
products = db.products.find({'category_id': category['_id']}).
skip((page_number - 1) * 12).
limit(12).
sort({helpful_votes: -1})
with
category = db.categories.findOne({'slug': 'outdoors'})
siblings = db.categories.find({'parent_id': category['parent_id']})
products = db.products.find({'category_id': category['_id']}).
skip((page_number - 1) * 12).
limit(12).
sort({average_review: -1})
-
Page 81, First code snippet
Replace
user_ids = db.orders.find({'line_items.sku': "9092",
purchase_date: {'$gt': new Date(2009, 0, 1)}},
{user_id: 1, _id: 0}).toArray().map(function(doc) { return doc['_id'] })
users = db.users.find({_id: {$in: user_ids}})
with
user_ids = db.orders.find({'line_items.sku': "9092",
purchase_date: {'$gt': new Date(2009, 0, 1)}},
{user_id: 1, _id: 0}).toArray().map(function(doc) { return doc['user_id'] })
users = db.users.find({_id: {$in: user_ids}})
-
Page 85, Middle of the page.
"Yoiu can query" should read "You can query."
-
Page 94, First code snippet
The line reading:
emit(shipping_month, {order_total: this.sub_total, items_total: 0});
should read:
emit(shipping_month, {order_total: this.sub_total, items_total: 0});
-
Page 94, Second code snippet
The lines reading:
var tmpTotal = 0;
var tmpItems = 0;
tmpTotal += doc.order_total;
tmpItems += doc.items_total;
return ( {order_total: tmpTotal, items_total: tmpItems} );
should read:
var tmpTotal = 0;
var tmpItems = 0;
values.forEach(function(doc) {
tmpTotal += doc.order_total;
tmpItems += doc.items_total;
});
return ( {order_total: tmpTotal, items_total: tmpItems} );
-
Page 118, Syntax Note
Replace the second code snippet with:
db.products.update({price: {$lte: 10}}, {$addToSet: {tags: 'cheap'}})
-
Page 124, 6.4.5, First paragraph, fifth sentence
"which document are in RAM" should read "while documents are in RAM"
-
Page 162, Third code snippet, sixth line
> use bookstore switched to db bookstore
should read
> use bookstore
switched to db bookstore
-
Page 192, Fouth code snippet
> rs.add("arete:30000")
> rs.add("arete:30001", {arbiterOnly: true})
should read
> rs.add("arete:30001")
> rs.add("arete:30002", {arbiterOnly: true})
-
Page 192, Fifth code snippet
$ mongo arete:30100
> rs.initiate()
> rs.add("arete:30100")
> rs.add("arete:30101", {arbiterOnly: true})
should read
$ mongo arete:30100
> rs.initiate()
> rs.add("arete:30101")
> rs.add("arete:30102", {arbiterOnly: true})
-
Page 195, 9.2.2, Second code snippet
The line
@col = @con['cloud']['spreadsheets']
should read
@col = @con['cloud-docs']['spreadsheets']
-
Page 222, Fourth code snippet
mongod hard nofile 2048
mongod hard nofile 10240
should read
mongodb soft nofile 2048
mongodb hard nofile 10240
-
Page 241, Code snippet
> mongo.tz
should read
> mongo.tgz
-
Page 244, First paragraph, first sentence
"There two ways" should read "There are two ways"
-
Page 252, First code snippet
username: "plotinus"
should read
username: "kbanker"
This then matches figure B.1.
-
Page 262, C.2, first paragraph, last sentence
"serve these object as well" should read "serve these objects as well"