Sha256: 53f4ac968c793696e40078e4a362feffac873afca18d3dfd761990e830303f04

Contents?: true

Size: 738 Bytes

Versions: 14

Compression:

Stored size: 738 Bytes

Contents

module Neo4j::Server
  class CypherLabel < Neo4j::Label
    extend Forwardable
    def_delegator :@session, :query_cypher_for
    attr_reader :name

    def initialize(session, name)
      @name = name
      @session = session
    end

    def create_index(*properties)
      response = @session._query("CREATE INDEX ON :`#{@name}`(#{properties.join(',')})")
      response.raise_error if response.error?
    end

    def drop_index(*properties)
      properties.each do |property|
        response = @session._query("DROP INDEX ON :`#{@name}`(#{property})")
        response.raise_error if response.error? && !response.error_msg.match(/No such INDEX ON/)
      end
    end

    def indexes
      @session.indexes(@name)
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
neo4j-core-3.0.0.rc.4 lib/neo4j-server/cypher_label.rb
neo4j-core-3.0.0.rc.1 lib/neo4j-server/cypher_label.rb
neo4j-core-3.0.0.alpha.19 lib/neo4j-server/cypher_label.rb
neo4j-core-3.0.0.alpha.18 lib/neo4j-server/cypher_label.rb
neo4j-core-3.0.0.alpha.17 lib/neo4j-server/cypher_label.rb
neo4j-core-3.0.0.alpha.16 lib/neo4j-server/cypher_label.rb
neo4j-core-3.0.0.alpha.15 lib/neo4j-server/cypher_label.rb
neo4j-core-3.0.0.alpha.14 lib/neo4j-server/cypher_label.rb
neo4j-core-3.0.0.alpha.13 lib/neo4j-server/cypher_label.rb
neo4j-core-3.0.0.alpha.12 lib/neo4j-server/cypher_label.rb
neo4j-core-3.0.0.alpha.11 lib/neo4j-server/cypher_label.rb
neo4j-core-3.0.0.alpha.10 lib/neo4j-server/cypher_label.rb
neo4j-core-3.0.0.alpha.9 lib/neo4j-server/cypher_label.rb
neo4j-core-3.0.0.alpha.8 lib/neo4j-server/cypher_label.rb