How to query in MongoDB array
<p>So, in my MongoDB I have several documents that look like this:</p>

<pre><code>{ 
    "_id" : ObjectId("56a17b7f5f7ecf32c5ee0077"), 
    "MediaID" : "302048", 
    "MediaName" : "El Viejo y el Mar", 
    "MediaTypeID" : "384", 
    "MediaTypeName" : "Movie", 
    "Rating" : NumberInt(0), 
    "Description" : "La versión cinematográfica de la obra inmortal de Ernest Hemingway, sobre un viejo pescador cubano que logra atrapar un pescado gigantesco que lo arrastra lejos de la orilla.", 
    "MediaWebLink" : "", 
    "Duration" : "5160", 
    "FileID" : "523852", 
    "like_counter" : NumberInt(0), 
    "EntryId" : "", 
    "Tags" : [
        {
            "Key" : "Clasificacion", 
            "Value" : "B"
        }, 
        {
            "Key" : "Genre", 
            "Value" : "Drama|Clásicas"
        }, 
        {
            "Key" : "Pais", 
            "Value" : "Estados Unidos"
        }, 
        {
            "Key" : "Directors", 
            "Value" : "John Sturges"
        }, 
        {
            "Key" : "Actors", 
            "Value" : "Spencer Tracy"
        }, 
        {
            "Key" : "Distribuidor", 
            "Value" : "Warner"
        }, 
        {
            "Key" : "Subtitles", 
            "Value" : "Español"
        }, 
        {
            "Key" : "Audio Version", 
            "Value" : "Inglés"
        }, 
        {
            "Key" : "Sub-Genre", 
            "Value" : ""
        }, 
        {
            "Key" : "Palabras Clave", 
            "Value" : ""
        }, 
        {
            "Key" : "Prizes", 
            "Value" : ""
        }
    ], 
    "Metas" : [
        {
            "Key" : "Nombre original", 
            "Value" : "The Old Man And The Sea"
        }, 
        {
            "Key" : "Synopsis corta", 
            "Value" : "Es la historia de un viejo pescador cubano que logra atrapar un pescado gigantesco que lo arrastra lejos de la orilla."
        }, 
        {
            "Key" : "Duracion", 
            "Value" : "01:26:00"
        }, 
        {
            "Key" : "Ano", 
            "Value" : "1958"
        }, 
        {
            "Key" : "Score de titulo", 
            "Value" : "4"
        }
    ], 
    "AdvertisingParameters" : [

    ] 

}
</code></pre>

<p>Inside the document, there is an array called TAGS, where one Key=Distribuidor and the Value = Warner
What I need is to do a query where I could get all the distincts "distribuidor" values for all the documents that I have.</p>

<p>So far I have tried this:</p>

<pre><code>db.catalogo.distinct( 'Tags.Value', { 'Tags.Key': 'Distribuidor' } )
</code></pre>

<p>But this is getting me all the values and not just for the "distribuidor" value.</p>

<p>Any advice?</p>