示例#1
0
            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();
            }
示例#2
0
            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();
            }
示例#3
0
            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();
            }
示例#4
0
        public void NodeWithMultipleProperties()
        {
            var visitor = new CypherVisitor();

            Node movie = Node.Create("Movie")
                         .Named("m")
                         .WithProperties(
                "Title",
                Cypher.LiteralOf("The Matrix"),
                "YearReleased",
                Cypher.LiteralOf(1999),
                "Released",
                Cypher.LiteralOf(true),
                "Rating",
                Cypher.LiteralOf(8.7)
                );

            movie.Visit(visitor);

            visitor.Print().MatchSnapshot();
        }
示例#5
0
            public void NodeWithTwoFieldsAndRelationshipProjectionNullWhere()
            {
                StatementBuilder statement = Cypher
                                             .Match(_userNode, _bikeNode)
                                             .Return(_userNode.Project(
                                                         "name",
                                                         "email",
                                                         "owns",
                                                         new PatternComprehension(
                                                             _userNode.RelationshipTo(_bikeNode, "OWNS"),
                                                             _bikeNode.Project("age",
                                                                               "test",
                                                                               new PatternComprehension(
                                                                                   _userNode.RelationshipTo(_bikeNode, "TEST"),
                                                                                   _bikeNode.Project("test"))))
                                                         ))
                                             .OrderBy(Cypher.Sort(_userNode.Property("name")).Descending());

                ;
                statement.Build().MatchSnapshot();
            }