How to find duplicates in a nested array in cosmos db without GROUP BY and COUNT

佐手、 提交于 2019-11-29 16:24:46

Yes as you mentioned CosmosDB currently does not support GROUP BY nor any other aggregation.

However, You can achieve group by using documentdb-lumenize. You load cube.string as a stored procedure, then you call it with an aggregation configuration.

{cubeConfig: {groupBy: "name", field: "stuff.name", f: "max"}}

that should do what you want.

or if you want to still use sql api you can try using Join as explained in the answer here

Personally i also faced the same issue, but i had to manage with my custom logic after retrieving the records with filtered conditions.

EDIT

With the comment below, it should be Yes as you mentioned CosmosDB currently does not support GROUP BY nor any other aggregation.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!