Module: Neo4j::Cypher

Defined in:
lib/neo4j-cypher.rb,
lib/neo4j-cypher/root.rb,
lib/neo4j-cypher/with.rb,
lib/neo4j-cypher/match.rb,
lib/neo4j-cypher/start.rb,
lib/neo4j-cypher/where.rb,
lib/neo4j-cypher/clause.rb,
lib/neo4j-cypher/create.rb,
lib/neo4j-cypher/result.rb,
lib/neo4j-cypher/return.rb,
lib/neo4j-cypher/context.rb,
lib/neo4j-cypher/foreach.rb,
lib/neo4j-cypher/rel_var.rb,
lib/neo4j-cypher/version.rb,
lib/neo4j-cypher/argument.rb,
lib/neo4j-cypher/node_var.rb,
lib/neo4j-cypher/operator.rb,
lib/neo4j-cypher/property.rb,
lib/neo4j-cypher/predicate.rb,
lib/neo4j-cypher/collection.rb,
lib/neo4j-cypher/clause_list.rb,
lib/neo4j-cypher/result_wrapper.rb,
lib/neo4j-cypher/abstract_filter.rb

Defined Under Namespace

Modules: Clause, Context Classes: AbstractFilter, Argument, ClauseList, Collection, Create, CreatePath, Delete, Foreach, Label, Limit, LuceneQuery, MatchStart, NodeVar, Operand, Operator, OrderBy, Predicate, Property, RelVar, Result, ResultWrapper, Return, ReturnItem, RootClause, Skip, Start, StartNode, StartRel, Where, With

Constant Summary collapse

VERSION =
'1.0.3'

Class Method Summary collapse

Class Method Details

.query(*args) { ... } ⇒ Cypher::Result

Creates a Cypher DSL query. To create a new cypher query you must initialize it either an String or a Block.

Examples:

START n0=node(3) MATCH (n0)--(x) RETURN x same as

Cypher.query { start n = node(3); match n <=> :x; ret :x }.to_s

START n0=node(3) MATCH (n0)-[:`r`]->(x) RETURN r same as

Cypher.query { node(3) > :r > :x; :r }

START n0=node(3) MATCH (n0)-->(x) RETURN x same as

Cypher.query { node(3) >> :x; :x }

Parameters:

  • args

    the argument for the dsl_block

Yields:

  • the block which will be evaluated in the context of this object in order to create an Cypher Query string

Yield Returns:

  • (Return, Object)

    If the return is not an instance of Return it will be converted it to a Return object (if possible).

Returns:



44
45
46
# File 'lib/neo4j-cypher.rb', line 44

def self.query(*args, &dsl_block)
  Result.new(*args, &dsl_block)
end