예제 #1
0
        public void LetSubQueryTest()
        {
            AQuery subquery = _db.Query
                              .For("y", AValue.Field(TestDocumentCollectionName))
                              .Collect()
                              .Aggregate("max", ANumeric.Max(AValue.Field("y.value")))
                              .Return(AReturn.Variable("max"));

            AQuery query = _db.Query
                           .Let("x", AValue.Subquery <int>(subquery));

            Assert.AreEqual("LET x = (FOR y IN " + TestDocumentCollectionName + " COLLECT AGGREGATE max = MAX(y.value) RETURN max)", query.GetExpression());
        }