Module: Arango::DocumentCollection::Indexes

Defined in:
lib/arango/document_collection/indexes.rb

Overview

Arango DocumentCollection Indexes

Instance Method Summary collapse

Instance Method Details

#create_index(type: "hash", fields:, unique: nil, sparse: nil, geoJson: nil, minLength: nil, deduplicate: nil) ⇒ Object

INDEXES ===



7
8
9
10
11
12
# File 'lib/arango/document_collection/indexes.rb', line 7

def create_index(type: "hash", fields:, unique: nil, sparse: nil,
                 geoJson: nil, minLength: nil, deduplicate: nil)
  Arango::Index.new(collection: self, type: type, fields: fields,
                    unique: unique, sparse: sparse, geo_json: geoJson,
                    min_length: minLength, deduplicate: deduplicate).create
end

#delete_index(index:) ⇒ Object



22
23
24
# File 'lib/arango/document_collection/indexes.rb', line 22

def delete_index index:
  index.delete
end

#get_index(id:) ⇒ Object



14
15
16
# File 'lib/arango/document_collection/indexes.rb', line 14

def get_index(id:)
  Arango::Index.get(collection: self, id: id)
end

#indexesObject



18
19
20
# File 'lib/arango/document_collection/indexes.rb', line 18

def indexes
  Arango::Index.list(collection: self)
end