title: Need help to storing an map of type interface in my mongodb database using golang
body: <p>I m in the process of creating application where my back end is in go lang and database is mongoDB. My problem is that  i have a map in my struct declared like </p>
  
  <pre><code>Data struct {
          data   map[interface{}]interface{}
  }
  </code></pre>
  
  <p>after adding values in to this like</p>
  
  <pre><code>var data Data
      data["us"]="country"
      data[2]="number"
      data["mother"]="son"
  </code></pre>
  
  <p>I m inserting it like</p>
  
  <pre><code>c.Insert(&amp;data)
  </code></pre>
  
  <p>When i insert this i m losing my key  and can only see the values...</p>
  
  <pre><code>{
      "_id" : Object Id("57e8d9048c1c6f751ccfaf50"),
      "data" : {
          "&lt;interface {} Value&gt;" : "country",
          "&lt;interface {} Value&gt;" : "number",
          "&lt;interface {} Value&gt;" : "son"
      },
  
  }
  </code></pre>
  
  <p>May i know any way possible to use interface and get both  key and values in my mongoDB. Thanks....</p>