Ejemplo n.º 1
0
            public void MatchNamedNodeSkipLimit()
            {
                Node             movie     = Cypher.Node("Movie").Named("m");
                StatementBuilder statement = Cypher.Match(movie).Return(movie).Skip(1).Limit(1);

                statement.Build().MatchSnapshot();
            }
Ejemplo n.º 2
0
            public void MatchThreeNodes()
            {
                StatementBuilder statement = Cypher
                                             .Match(_bikeNode, _userNode, Cypher.Node("U").Named("o"));

                statement.Build().MatchSnapshot();
            }
Ejemplo n.º 3
0
            public void ReturnAsterisk()
            {
                StatementBuilder statement = Cypher
                                             .Match(_bikeNode, _userNode, Cypher.Node("U").Named("o"))
                                             .Return(Cypher.Asterisk);

                statement.Build().MatchSnapshot();
            }
Ejemplo n.º 4
0
            public void NodeWithProperties()
            {
                StatementBuilder statement = Cypher
                                             .Match(_bikeNode, _userNode, Cypher.Node("U").Named("o"))
                                             .Return(_bikeNode, _userNode);

                statement.Build().MatchSnapshot();
            }
Ejemplo n.º 5
0
            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();
            }
Ejemplo n.º 6
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();
            }
Ejemplo n.º 7
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();
            }
Ejemplo n.º 8
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();
            }