diff --git a/lib/couchrest/mixins/design_doc.rb b/lib/couchrest/mixins/design_doc.rb
index <HASH>..<HASH> 100644
--- a/lib/couchrest/mixins/design_doc.rb
+++ b/lib/couchrest/mixins/design_doc.rb
@@ -35,7 +35,7 @@ module CouchRest
               'all' => {
                 'map' => "function(doc) {
                   if (doc['couchrest-type'] == '#{self.to_s}') {
-                    emit(null,1);
+                    emit(doc['_id'],1);
                   }
                 }"
               }
modified the 'all' view to emit doc ids so we can do Model.all(:keys => [1,2])