
Security News
New Website “Is It Really FOSS?” Tracks Transparency in Open Source Distribution Models
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
MongoModel is a Ruby ORM for interfacing with MongoDB databases.
MongoModel is distributed as a gem. Install with:
gem install mongomodel
For performance, you should probably also install the BSON C extensions:
gem install bson_ext
Add MongoModel to your Gemfile (and run bundle install
):
gem 'mongomodel'
Create the configuration file config/mongomodel.yml
:
rails generate mongo_model:config DATABASENAME
Generating a model/document:
rails generate model Article title:string body:string published_at:time approved:boolean
Generating an embedded document:
rails generate model Chapter title:string body:string -E
class Article < MongoModel::Document
property :title, String, :default => 'Untitled'
property :body, String
property :published_at, Time, :protected => true
property :approved, Boolean, :default => false, :protected => true
timestamps!
validates_presence_of :title, :body
belongs_to :author, :class => User
scope :published, where(:published_at.ne => nil)
end
MongoModel can be configured similarly to ActiveRecord by creating/editing config/mongomodel.yml
. The most basic configuration might look like:
development:
database: mymongodbname
host: localhost
port: 27017
The config file also supports specifying the username, password, pool_size, password and replicas. Running rails generate mongo_model:config DATABASENAME
will generate a basic config file for you.
When working with replica sets, replace the host/port configuration with an array of replicas (host:port
):
production:
database: database_name
replicas:
- some.host.com:27017
- another.host.com:27017
username: username
password: password
FAQs
Unknown package
We found that mongomodel demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.