Permalink
Browse files

update README view example to match recent changes

  • Loading branch information...
1 parent 452c96b commit ac7c4c301dd07f511cd38d01fa4be762a94891dc Wesley Beary committed Jul 21, 2008
Showing with 1 addition and 1 deletion.
  1. +1 −1 adapters/dm-couchdb-adapter/README.txt
View
2 adapters/dm-couchdb-adapter/README.txt
@@ -21,7 +21,7 @@ class User
include DataMapper::Resource
property :name, String
- view :by_name, "function(doc) { if (doc.type == 'user') map(doc.name, doc) }"
+ view :by_name, { "map" => "function(doc) { if (doc.type == 'user') { emit(doc.name, doc); } }" }
end
You could then call User.by_name to get a listing of users ordered by name, or pass a key to try and find a specific user by their name, ie User.by_name(:key => 'username').

0 comments on commit ac7c4c3

Please sign in to comment.