lib/rasti/db/collection.rb in rasti-db-0.2.4 vs lib/rasti/db/collection.rb in rasti-db-0.2.5
- old
+ new
@@ -1,10 +1,10 @@
module Rasti
module DB
class Collection
- QUERY_METHODS = (Query::DATASET_CHAINED_METHODS + [:graph, :count, :all, :first]).freeze
+ QUERY_METHODS = (Query::DATASET_CHAINED_METHODS + [:graph, :count, :all, :first, :pluck, :primary_keys, :any?, :empty?, :raw]).freeze
include Helpers::WithSchema
class << self
@@ -175,10 +175,10 @@
query.public_send method, *args, &block
end
end
def exists?(filter=nil, &block)
- build_query(filter, &block).count > 0
+ build_query(filter, &block).any?
end
def detect(filter=nil, &block)
build_query(filter, &block).first
end
\ No newline at end of file