How to query Azure DocumentDB with an equivalent of the SELECT DISTINCT statement

痞子三分冷 提交于 2019-12-23 09:35:11

问题


DocumentDb don't support the DISTINCT statement. I have documents in DocumentDB with the following structure (thousands of documents):

{
    "type" : "type1",
    "data" : {
        ...
    }
},{
    "type" : "type2",
    "data" : {
        ...
    }
},{
    "type" : "type2",
    "data" : {
        ...
    }
},{
    "type" : "type2",
    "data" : {
        ...
    }
}

How can I query the collection and get the following result:

{
    "type" : "type1"
},{
    "type" : "type2"
}

回答1:


Azure DocumentDB currently does not support DISTINCT.

Please voice your opinion and vote for this feature on DocumentDB's feedback forum.



来源:https://stackoverflow.com/questions/26928950/how-to-query-azure-documentdb-with-an-equivalent-of-the-select-distinct-statemen

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