Ejemplo n.º 1
0
        public void FindReferences()
        {
            using (var store = GetDocumentStore())
            {
                Samples.CreateSimpleData(store);
                using (var session = store.OpenSession())
                {
                    var result = session.Advanced.RawQuery <JObject>(@"match (Entities as e)-[References as r]->(Entities as e2)").ToList();

                    Assert.Equal(3, result.Count);
                    Assert.Contains(result,
                                    item => item["e"].Value <string>("Name") == "A" &&
                                    item["e2"].Value <string>("Name") == "B");
                    Assert.Contains(result,
                                    item => item["e"].Value <string>("Name") == "B" &&
                                    item["e2"].Value <string>("Name") == "C");
                    Assert.Contains(result,
                                    item => item["e"].Value <string>("Name") == "C" &&
                                    item["e2"].Value <string>("Name") == "A");
                }
            }
        }