QueryProxyMethods

Constants

  • FIRST
  • LAST

Methods

#all_rels_to

Returns all relationships across a QueryProxy chain between a given node or array of nodes and the preceeding link.

+ show/hide code
#as_models

Takes an Array of ActiveNode models and applies the appropriate WHERE clause So for a Teacher model inheriting from a Person model and an Article model if you called .as_models([Teacher, Article]) The where clause would look something like:

WHERE (node_var:Teacher:Person OR node_var:Article)
+ show/hide code

#blank?

+ show/hide code

#count

+ show/hide code
#delete

Deletes the relationship between a node and its last link in the QueryProxy chain. Executed in the database, callbacks will not run.

+ show/hide code
#delete_all

Deletes a group of nodes and relationships within a QP chain. When identifier is omitted, it will remove the last link in the chain. The optional argument must be a node identifier. A relationship identifier will result in a Cypher Error

+ show/hide code
#delete_all_rels

Deletes the relationships between all nodes for the last step in the QueryProxy chain. Executed in the database, callbacks will not be run.

+ show/hide code
#destroy

Returns all relationships between a node and its last link in the QueryProxy chain, destroys them in Ruby. Callbacks will be run.

+ show/hide code

#empty?

+ show/hide code

#exists?

+ show/hide code
#find

Give ability to call #find on associations to get a scoped find Doesn’t pass through via method_missing because Enumerable has a #find method

+ show/hide code
#find_or_create_by

When called, this method returns a single node that satisfies the match specified in the params hash. If no existing node is found to satisfy the match, one is created or associated as expected.

+ show/hide code

#first

+ show/hide code
#first_rel_to

Gives you the first relationship between the last link of a QueryProxy chain and a given node Shorthand for MATCH (start)-[r]-(other_node) WHERE ID(other_node) = #{other_node.neo_id} RETURN r

+ show/hide code

#include?

+ show/hide code

#last

+ show/hide code

#length

+ show/hide code
#limit_value

TODO: update this with public API methods if/when they are exposed

+ show/hide code
#match_to

Shorthand for MATCH (start)-[r]-(other_node) WHERE ID(other_node) = #{other_node.neo_id} The node param can be a persisted ActiveNode instance, any string or integer, or nil. When it’s a node, it’ll use the object’s neo_id, which is fastest. When not nil, it’ll figure out the primary key of that model. When nil, it uses 1 = 2 to prevent matching all records, which is the default behavior when nil is passed to where in QueryProxy.

+ show/hide code
#optional

A shortcut for attaching a new, optional match to the end of a QueryProxy chain.

+ show/hide code

#order_property

+ show/hide code

#rel

+ show/hide code

#rels

+ show/hide code
#rels_to

Returns all relationships across a QueryProxy chain between a given node or array of nodes and the preceeding link.

+ show/hide code
#replace_with

Deletes the relationships between all nodes for the last step in the QueryProxy chain and replaces them with relationships to the given nodes. Executed in the database, callbacks will not be run.

+ show/hide code

#size

+ show/hide code