Module: Neo4j::ActiveNode::Query
- Extended by:
- ActiveSupport::Concern
- Included in:
- Neo4j::ActiveNode
- Defined in:
- lib/neo4j/active_node/query.rb,
lib/neo4j/active_node/query/query_proxy.rb,
lib/neo4j/active_node/query/query_proxy_link.rb,
lib/neo4j/active_node/query/query_proxy_methods.rb,
lib/neo4j/active_node/query/query_proxy_enumerable.rb,
lib/neo4j/active_node/query/query_proxy_eager_loading.rb,
lib/neo4j/active_node/query/query_proxy_find_in_batches.rb,
lib/neo4j/active_node/query/query_proxy_methods_of_mass_updating.rb,
lib/neo4j/active_node/query/query_proxy_eager_loading/association_tree.rb
Overview
Helper methods to return Neo4j::Core::Query objects. A query object can be used to successively build a cypher query
person.query_as(:n).match('n-[:friend]-o').return(o: :name) # Return the names of all the person's friends
Defined Under Namespace
Modules: ClassMethods, QueryProxyEagerLoading, QueryProxyEnumerable, QueryProxyFindInBatches, QueryProxyMethods, QueryProxyMethodsOfMassUpdating Classes: QueryProxy
Instance Method Summary collapse
-
#as(node_var) ⇒ Neo4j::ActiveNode::Query::QueryProxy
Starts a new QueryProxy with the starting identifier set to the given argument and QueryProxy source_object set to the node instance.
-
#query_as(node_var) ⇒ Neo4j::Core::Query
Returns a Query object with the current node matched the specified variable name.
Instance Method Details
#as(node_var) ⇒ Neo4j::ActiveNode::Query::QueryProxy
Starts a new QueryProxy with the starting identifier set to the given argument and QueryProxy source_object set to the node instance. This method does not exist within QueryProxy and can only be used to start a new chain.
31 32 33 |
# File 'lib/neo4j/active_node/query.rb', line 31 def as(node_var) self.class.query_proxy(node: node_var, source_object: self).match_to(self) end |
#query_as(node_var) ⇒ Neo4j::Core::Query
Returns a Query object with the current node matched the specified variable name
18 19 20 |
# File 'lib/neo4j/active_node/query.rb', line 18 def query_as(node_var) self.class.query_as(node_var, false).where("ID(#{node_var})" => self.neo_id) end |