title: How to create a RavenDB index that returns a list of strings?
body: <p>I have a collection of documents "WineDocument" on the form:</p>
  
  <pre><code>{
    "Name": "Barbicato Morellino Di Scansano",
    "Country": "Italy",
    "Region": "Tuscany",
  }
  </code></pre>
  
  <p>I need to make a query to find all unique values of the "Country" field. I have been trying to create an index looking something like:</p>
  
  <pre><code>class WineCountriesIndex: AbstractIndexCreationTask&lt;WineDocument, string&gt; {
          public BeverageCountriesIndex() {
              Map = wines =&gt; from wine in wines
                             where wine.Country != null
                             select new { Key = wine.Country };
              Reduce = results =&gt; from result in results
                                  group result by result into g
                                  select new { Key = g.Key };
          }
      }
  </code></pre>
  
  <p>The index gets created ok and I try to use it with the following code:</p>
  
  <pre><code>IList&lt;string&gt; countries = session.Query&lt;string, WineCountriesIndex&gt;().ToList();
  </code></pre>
  
  <p>But this gives an JsonSerializationException: "Cannot deserialize JSON object into type 'System.String'.". I guess it is because the Json parser cannot parse { Key = "Italy } to a string. But I don't know how to make a map/reduce return just a string.</p>