在下边的例子我们使用COUNT()函数来告诉我们有多少文档在桶里。
COUNT() Query:
SELECT COUNT(*) AS count FROM tutorial
结果:
{ "results": [ { "count": 6 } ] }
AVG() Query:
SELECT COUNT(*) AS count, AVG(c.age) AS avg_age FROM tutorial t UNNEST t.children c WHERE c.age > 10
结果:
{ "results": [ { "avg_age": 18, "count": 4 } ] }
Last updated 5 years ago
Was this helpful?