mongo_orm Exception: missing bson key: publish_acl (Exception)

When you extend your field definitions in the mongo_orm document classes, specifically with embedded documents, you might run into the following runtime (!) error: Exception: missing bson key: <name> (Exception) This is not an error in your code – your code is raising, because the database structure is not as it expects it to be!…

Weiterlesen

mongo_orm custom name for collection

mongo_orm will automatically determine the name for your collection by using the Module and Class name, and appending an “s”. In cases where you want to name your collection, you can simply do this: class PapiTest < Mongo::ORM::Document     collection_name “Buster”     field test : String end get “/” do     pt = PapiTest.new     pt.test = “I want…

Weiterlesen

Instructions for adding a user to a mongo database for mongo_orm

You don’t want your web application to access the database using your database admin user. Additionally you want it to access only one specific database – maybe you have additional databases running in your mongo instance. Prerequisites: mongo_orm expects the database configuration as environment variables or as a file config/database.yml in your project. The config/database.yml…

Weiterlesen