Using MongoModel without Rails

37 views
Skip to first unread message

Kyle

unread,
Nov 10, 2011, 12:48:56 PM11/10/11
to MongoModel
I'm interested in using Mongo Model with Sinatra or another similiarly
minimal framework. Is there a simple way to manually instantiate the
connection to mongodb?

Thanks,
Kyle

Sam

unread,
Nov 10, 2011, 5:54:07 PM11/10/11
to MongoModel
Hi Kyle,

The only setup code you should need is:

require "mongomodel"
MongoModel.configuration = { "database" => "mydb" }

Then you should be able to access the MongoDB database object at
MongoModel.database and begin defining your models.

Thanks,
Sam
Reply all
Reply to author
Forward
0 new messages