38. > use test
switched to db test
db.quotes.save({
text: "You can observe a lot just by watching.",
from: "Yogi Berra", created_at: new Date()
});
db.quotes.save({
text: "Silence is one of the hardest arguments to refute.",
from: "Josh Billings", created_at: new Date()
});
Samstag, 23. Oktober 2010
39. > use test
switched to db test
db.quotes.save({
text: "You can observe a lot just by watching.",
from: "Yogi Berra", created_at: new Date()
});
db.quotes.save({
text: "Silence is one of the hardest arguments to refute.",
from: "Josh Billings", created_at: new Date()
});
Samstag, 23. Oktober 2010
74. doc = {
:text => "You can observe a lot just by watching.",
:from => "Yogi Berra",
:created_at => Time.now
}
@db['quotes'].insert(doc)
Samstag, 23. Oktober 2010
149. class Person
include MongoMapper::Document
key :name
one :address
key :tags, Array
end
class Address
include MongoMapper::Document
key :street
key :city
key :country
key :zip
end
Samstag, 23. Oktober 2010
168. class Person
include Mongoid::Document
field :name
embeds_one :address
field :tags, :type => Array
end
class Address
include Mongoid::Document
field :street
field :city
field :country
field :zip
end
Samstag, 23. Oktober 2010