aludvigsen
aludvigsen

Reputation: 5981

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

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"
}

Upvotes: 6

Views: 5511

Answers (1)

Andrew Liu
Andrew Liu

Reputation: 8119

Azure DocumentDB currently does not support DISTINCT.

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

Upvotes: 7

Related Questions