如何使用SELECT DISTINCT语句的等效方法查询Azure DocumentDB

alu*_*sen 6 json azure azure-cosmosdb

DocumentDb不支持该DISTINCT语句.我在DocumentDB中有以下结构的文档(数千个文档):

{
    "type" : "type1",
    "data" : {
        ...
    }
},{
    "type" : "type2",
    "data" : {
        ...
    }
},{
    "type" : "type2",
    "data" : {
        ...
    }
},{
    "type" : "type2",
    "data" : {
        ...
    }
}
Run Code Online (Sandbox Code Playgroud)

如何查询集合并获得以下结果:

{
    "type" : "type1"
},{
    "type" : "type2"
}
Run Code Online (Sandbox Code Playgroud)

And*_*Liu 7

Azure DocumentDB目前不支持DISTINCT.

请在DocumentDB的反馈论坛上表达您的意见并投票支持此功能.