Class: Couchbase::PrefixScan

Inherits:
Object
  • Object
show all
Defined in:
lib/couchbase/key_value_scan.rb

Overview

A prefix scan performs a scan that includes all documents whose keys start with the given prefix

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(prefix) ⇒ PrefixScan

Creates an instance of a PrefixScan scan type

Parameters:

  • prefix (String, nil)

    the prefix all document keys should start with



80
81
82
# File 'lib/couchbase/key_value_scan.rb', line 80

def initialize(prefix)
  @prefix = prefix
end

Instance Attribute Details

#prefixString

Returns:

  • (String)


75
76
77
# File 'lib/couchbase/key_value_scan.rb', line 75

def prefix
  @prefix
end

Instance Method Details

#to_backendObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



85
86
87
88
89
90
# File 'lib/couchbase/key_value_scan.rb', line 85

def to_backend
  {
    scan_type: :prefix,
    prefix: @prefix,
  }
end