8. post = {
"_id" : ObjectId("4c67892ba8d8770eb8000003"),
"title" : "Welcome to the Hackety Site!",
"body" : "This is an intial post, so that you can see how
everything looks. ",
"updated_at" : "Sun Aug 15 2010 02:28:59 GMT-0400 (EDT)"
"created_at" : "Sun Aug 15 2010 02:28:59 GMT-0400 (EDT)",
"comments" : [
{
"body" : "This post is awesome! I've never seen such
insightful writing!!",
"author" : "somebody",
"_id" : ObjectId("4c67892ba8d8770eb8000004"),
"author_email" : "somebody@example.com"
}
],
}
9. post = {
"_id" : ObjectId("4c67892ba8d8770eb8000003"),
"title" : "Welcome to the Hackety Site!",
"body" : "This is an intial post, so that you can see how
everything looks. ",
"updated_at" : "Sun Aug 15 2010 02:28:59 GMT-0400 (EDT)"
"created_at" : "Sun Aug 15 2010 02:28:59 GMT-0400 (EDT)",
"comments" : [
{
"body" : "This post is awesome! I've never seen such
insightful writing!!",
"author" : "somebody",
"_id" : ObjectId("4c67892ba8d8770eb8000004"),
"author_email" : "somebody@example.com"
}
],
}
10. post = {
"_id" : ObjectId("4c67892ba8d8770eb8000003"),
"title" : "Welcome to the Hackety Site!",
"body" : "This is an intial post, so that you can see how
everything looks. ",
"updated_at" : "Sun Aug 15 2010 02:28:59 GMT-0400 (EDT)"
"created_at" : "Sun Aug 15 2010 02:28:59 GMT-0400 (EDT)",
"comments" : [
{
"body" : "This post is awesome! I've never seen such
insightful writing!!",
"author" : "somebody",
"_id" : ObjectId("4c67892ba8d8770eb8000004"),
"author_email" : "somebody@example.com"
}
],
}
11. post = {
"_id" : ObjectId("4c67892ba8d8770eb8000003"),
"title" : "Welcome to the Hackety Site!",
"body" : "This is an intial post, so that you can see how
everything looks. ",
"updated_at" : "Sun Aug 15 2010 02:28:59 GMT-0400 (EDT)"
"created_at" : "Sun Aug 15 2010 02:28:59 GMT-0400 (EDT)",
"comments" : [
{
"body" : "This post is awesome! I've never seen such
insightful writing!!",
"author" : "somebody",
"_id" : ObjectId("4c67892ba8d8770eb8000004"),
"author_email" : "somebody@example.com"
}
],
}
13. post = {
"_id" : ObjectId("4c67892ba8d8770eb8000004"),
"title" : "Here’s a cool update!",
"body" : "This is an explanation of all the new features!",
"updated_at" : "Sun Aug 15 2010 02:29:60 GMT-0400 (EDT)"
"created_at" : "Sun Aug 15 2010 02:29:60 GMT-0400 (EDT)",
}
14. $ mongo
MongoDB shell version: 1.6.3
connecting to: test
> use hackety-development;
switched to db hackety-development
> show collections;
discussions
hackers
messages
posts
programs
system.indexes
users
> db.posts.find();
{ "_id" : ObjectId("...
23. $ rvm use 1.9.2
info: Using ruby 1.9.2 p0
$ irb
ruby-1.9.2-p0 > {lol: "wut"}
=> {:lol=>"wut"}
ruby-1.9.2-p0 >
24. “Why I think Mongo is to
Databases what Rails was
to Frameworks”
http://railstips.org/blog/archives/2009/12/18/why-i-think-mongo-is-to-databases-what-rails-was-to-frameworks/
33. foldl :: (a -> b -> a) -> a -> [b] -> a
(takes a function with two arguments,
a starting point, and a list, and repeatedly
calls that function until only one value is left)