func Create(c *gin.Context) {
	db := c.MustGet("db").(*mgo.Database)
	article := models.Article{}
	err := c.Bind(&article)
	if err != nil {
		c.Error(err)
		return
	}
	err = db.C(models.CollectionArticle).Insert(article)
	if err != nil {
		c.Error(err)
	}
	c.Redirect(http.StatusMovedPermanently, "/articles")
}
Create an article
package articles
import (
	"net/http"
	"time"
	"gopkg.in/mgo.v2"
	"gopkg.in/mgo.v2/bson"
	"github.com/gin-gonic/gin"
	"github.com/madhums/go-gin-mgo-demo/models"
)
func New(c *gin.Context) {
	article := models.Article{}
	c.HTML(http.StatusOK, "articles/form", gin.H{
		"title":   "New article",
		"article": article,
	})
}