mongodb - Switching databases at runtime in Mongoid 3.0 -
i have sinatra application running on unicorn uses mongoid models. have several mongo databases same construction different content, , select right database each user when he/she logs in. wondering if possible mongoid 3.0.
you can utilize with operator before every query:
model.with(database: method_to_get_the_db_name).create mongodb mongoid
No comments:
Post a Comment