mongo-ruby-driver/lib
John Nunemaker 53ad43fedc Added transformer concept.
Can be passed to find/find_one, which in turn is passed to cursor. It is an optional block that makes it easier to turn documents that are returned into hashes.

cursor = collection.find({...}, :transformer => Proc.new { |doc| User.load(doc) })
cursor.next # returns instance of User instead of ordered hash

This will allow MongoMapper, ToyStore and other object mappers to take better advantage of Cursors. No more calling to_a and mapping to instances.
2011-03-23 15:26:34 -04:00
..
bson RUBY-245 Unique object id with timestamp 2011-03-15 16:40:27 -04:00
mongo Added transformer concept. 2011-03-23 15:26:34 -04:00
bson.rb BUMP 1.2.4 2011-02-23 14:51:49 -05:00
mongo.rb BUMP 1.2.4 2011-02-23 14:51:49 -05:00