title: Serialising a form from a request and putting in in mongo
body: <p>I have tried to put a form from a request (I don't know the structure of the data that I get for the moment) in a mongo database.</p>
  
  <p>Here is my code :</p>
  
  <pre><code>fmt.Println(r.Form)
  for key, values := range r.Form {   // range over map
      for _, value := range values {    // range over []string
          fmt.Println(key, value)
      }
  
  }
  fmt.Println(r.Form)
  decoder := json.NewDecoder(r.Body)
  session, err := mgo.Dial("127.0.0.1")
  if err != nil {
      panic(err)
  }
  defer session.Close()
  
  // Optional. Switch the session to a monotonic behavior.
  session.SetMode(mgo.Monotonic, true)
  
  c2 := session.DB("finger_bag").C("finger")
  data, err := bson.Marshal(decoder)
  err2 := c2.Insert(data)
  if (err2 != nil){
      Info.Println("error")
      Info.Println(err2)
  }
  </code></pre>
  
  <p>If anyone have any idea how to do it.</p>