revel-mgo
Original revmgo: https://github.com/jgraham909/revmgo
======
mgo module for revel framework
Settings can be configured via the following directives in app.conf.
module.rmgo=github.com/creativelikeadog/revel-mgo
Please review the documentation at Revel - Modules - Overview for more information
Please review the documentation at mgo.Session.Dial() for information on the syntax and valid settings.
This can be one of 'clone', 'copy', 'new'. See mgo.Session.New() for more information.
The name of the default database you want to use
In any controller you want to have mongo connectivity you must include the MongoController.
Add the following import line in source files that will embed MongoController.
"github.com/creativelikeadog/revel-mgo/app"
Embed the MongoController on your custom controller;
type Application struct {
*revel.Controller
rmgo.MongoController
// Other fields
}
Your controller will now have a MongoSession variable of type *mgo.Session and a Database variable of type *mgo.Database. Use this to query your mongo datastore.
revel run github.com/creativelikeadog/revel-mgo/sample