lib/riak/bucket.rb in riak-client-1.4.0 vs lib/riak/bucket.rb in riak-client-1.4.1
- old
+ new
@@ -146,12 +146,13 @@
# @param [Hash] options quorum options
# @option options [Fixnum] :r - the read quorum value for the request (R)
# @return [true, false] whether the key exists in this bucket
def exists?(key, options={})
begin
- get(key, options)
+ get(key, options.merge({ :head => true }))
true
- rescue Riak::FailedRequest
+ rescue Riak::FailedRequest => e
+ raise e unless e.not_found?
false
end
end
alias :exist? :exists?