public void MatchNamedNodeSkipLimit() { Node movie = Cypher.Node("Movie").Named("m"); StatementBuilder statement = Cypher.Match(movie).Return(movie).Skip(1).Limit(1); statement.Build().MatchSnapshot(); }
public void AliasedExpressionInReturn() { StatementBuilder statement = Cypher.Match(_bikeNode) .Return(_bikeNode.As("bike")); statement.Build().MatchSnapshot(); }
public void MatchThreeNodes() { StatementBuilder statement = Cypher .Match(_bikeNode, _userNode, Cypher.Node("U").Named("o")); statement.Build().MatchSnapshot(); }
public void SimpleRelationshipSingleTypeWithMinimumLength() { StatementBuilder statement = Cypher.Match( _userNode.RelationshipTo(_bikeNode, "OWNS").Minimum(3)) .Return(_bikeNode, _userNode); statement.Build().MatchSnapshot(); }
public void SimpleRelationshipMultipleTypes() { StatementBuilder statement = Cypher .Match(_userNode.RelationshipTo(_bikeNode, "OWNS", "RIDES")) .Return(_bikeNode, _userNode); statement.Build().MatchSnapshot(); }
public void NodeWithProperties() { StatementBuilder statement = Cypher .Match(_bikeNode, _userNode, Cypher.Node("U").Named("o")) .Return(_bikeNode, _userNode); statement.Build().MatchSnapshot(); }
public void ReturnAsterisk() { StatementBuilder statement = Cypher .Match(_bikeNode, _userNode, Cypher.Node("U").Named("o")) .Return(Cypher.Asterisk); statement.Build().MatchSnapshot(); }
public void NodeWithTwoFieldsProjection() { StatementBuilder statement = Cypher .Match(_userNode) .Return(_userNode.Project("name", "email")); statement.Build().MatchSnapshot(); }
public void MatchTwoNamedNode() { Node movie = Node.Create("Movie").Named("m"); Node bike = Node.Create("Bike").Named("b"); StatementBuilder statement = Cypher.Match(movie, bike); statement.Build().MatchSnapshot(); }
public void PropertyIsNull() { StatementBuilder statement = Cypher .Match(_userNode) .Where(_userNode.Property("email").IsNull()) .Return(_userNode); statement.Build().MatchSnapshot(); }
public void NodeWithTwoFieldsProjectionWithOrderByDescending() { StatementBuilder statement = Cypher .Match(_userNode) .Return(_userNode.Project("name", "email")) .OrderBy(Cypher.Sort(_userNode.Property("name")).Descending()); statement.Build().MatchSnapshot(); }
public void SimpleRelationshipSingleTypeWithProperties() { StatementBuilder statement = Cypher.Match( _userNode.RelationshipTo(_bikeNode, "OWNS") .WithProperties( Cypher.MapOf("boughtOn", Cypher.LiteralOf("2021-03-02")))) .Return(_bikeNode, _userNode); statement.Build().MatchSnapshot(); }
public void PropertyIsEqual() { StatementBuilder statement = Cypher .Match(_userNode) .Where(_userNode.Property("email") .IsEqualTo(Cypher.LiteralOf("*****@*****.**"))) .Return(_userNode); statement.Build().MatchSnapshot(); }
public void PredicateExists() { Relationship?condition = _userNode.RelationshipTo(_bikeNode, "OWNS"); StatementBuilder statement = Cypher .Match(new Where(Predicates.Exists(condition)), _userNode) .Return(_userNode); statement.Build().MatchSnapshot(); }
public void OrCondition() { StatementBuilder statement = Cypher .Match(_userNode) .Where(_userNode.Property("email") .IsEqualTo(Cypher.LiteralOf("*****@*****.**")) .Or(_userNode.Property("address").IsNull())) .Return(_userNode); statement.Build().MatchSnapshot(); }
public void ChainedRelationshipSingle() { Node tripNode = Cypher.Node("Trip").Named("t"); StatementBuilder statement = Cypher .Match(_userNode .RelationshipTo(_bikeNode, "OWNS") .Named("r1") .RelationshipTo(tripNode, "USED_ON") .Named("r2") ) .Return(_bikeNode, _userNode); statement.Build().MatchSnapshot(); }
public void NodeWithTwoFieldsAndRelationshipProjection() { StatementBuilder statement = Cypher .Match(_userNode, _bikeNode) .Return(_userNode.Project( "name", "email", "owns", new PatternComprehension( _userNode.RelationshipTo(_bikeNode, "OWNS"), new Where(_bikeNode.Property("age").IsEqualTo(Cypher.LiteralOf(12))), _bikeNode.Project("age")) )) .OrderBy(Cypher.Sort(_userNode.Property("name")).Descending()); ; statement.Build().MatchSnapshot(); }
public void ChainedRelationshipMultiple() { Node tripNode = Cypher.Node("Trip").Named("t"); StatementBuilder statement = Cypher .Match(_userNode .RelationshipTo(_bikeNode, "OWNS") .Named("r1") .RelationshipTo(tripNode, "USED_ON") .Named("r2") .RelationshipFrom(_userNode, "WAS_ON") .Named("x") .RelationshipBetween(Cypher.Node("SOMETHING")) .Named("y") ) .Return(_bikeNode, _userNode); statement.Build().MatchSnapshot(); }
public void MatchNamedNodeWithProperties() { Node movie = Cypher.Node("Movie") .Named("m") .WithProperties( "title", Cypher.LiteralOf("The Matrix"), "yearReleased", Cypher.LiteralOf(1999), "released", Cypher.LiteralOf(true), "rating", Cypher.LiteralOf(8.7) ); StatementBuilder statement = Cypher.Match(movie); statement.Build().MatchSnapshot(); }
public void PredicateAll() { var compoundCondition = new CompoundCondition(Operator.And); Node bikeNode = Cypher.Node("Bike"); Relationship userBikes = _userNode.RelationshipTo(bikeNode, "OWNS"); compoundCondition.Add(Predicates.Exists(userBikes)); SymbolicName userOwns = Cypher.Name("userOwns"); //var test = Cypher.ListWith(userOwns).In(); StatementBuilder statement = Cypher .Match(new Where(compoundCondition), _userNode) .Return(_userNode); statement.Build().MatchSnapshot(); }