naive_bayes/resources/ruby/scope.rb
# Set options for the query.
#
# @param q_opts [Hash] Query options.
#
# @option q_opts :snapshot [true, false] Prevents returning docs more
#   than once.
# @option q_opts :max_scan [Integer] Constrain the query to only scan the
#   specified number of docs.
# @option q_opts :show_disk_loc [true, false] Return disk location info
#   as a field in each doc.
#
# @return [Hash, Scope] Either the query options or a new +Scope+.
Set options for the query.
Set options for the query .
def query_opts(q_opts = nil)
      return query_opts_hash if q_opts.nil?
      opts = @opts.dup
      [:snapshot, :max_scan, :show_disk_loc].each do |k|
        q_opts[k].nil? ? opts.delete(k) : opts.merge!(k => q_opts[k])
      end
      Scope.new(collection, selector, opts)
    end
def query_opts ( q_opts = nil ) return query_opts_hash if q_opts . nil? opts = @opts . dup [ :snapshot , :max_scan , :show_disk_loc ] . each do | k | q_opts [ k ] . nil? ? opts . delete ( k ) : opts . merge! ( k => q_opts [ k ] ) end Scope . new ( collection , selector , opts ) end
Set options for the query.
Set options for the query .
Either the query options or a new +Scope+.
Either the query options or a new + Scope + .
Hash, Scope
q_opts
:show_disk_loc  Return disk location info as a field in each doc.
: show_disk_loc Return disk location info as a field in each doc .