lib/plucky/query.rb in plucky-0.5.1 vs lib/plucky/query.rb in plucky-0.5.2
- old
+ new
@@ -98,11 +98,13 @@
query = clone.amend(opts)
query.collection.remove(query.criteria.to_hash, driver_opts)
end
def count(opts={})
- find_each(opts).count
+ query = clone.amend(opts)
+ cursor = query.collection.find(query.criteria.to_hash, query.options.to_hash)
+ cursor.count
end
def size
count
end
@@ -222,6 +224,6 @@
the_fields = {}
field_list.each {|field| the_fields[field.to_sym] = value}
clone.tap { |query| query.options[:fields] = the_fields}
end
end
-end
\ No newline at end of file
+end