Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 31 additions & 3 deletions src/_posts/languages/ruby/2000-01-01-mongoid.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
---
title: Configure Mongoid
nav: Mongoid
modified_at: 2023-12-22 00:00:00
modified_at: 2026-05-18 00:00:00
tags: ruby mongoid mongodb
---

{% warning %}
Use the Mongo Ruby driver `mongo` up to version `2.23.0` when connecting to
Comment thread
benjaminach marked this conversation as resolved.
Outdated
MongoDB Server `3.6` or `4.0`.
{% endwarning %}

You need to create the file `config/mongoid.yml` in order to configure Mongoid:

```yaml
Expand All @@ -20,6 +25,29 @@ production:
uri: <%= ENV['SCALINGO_MONGO_URL'] %>
```

Add the `mongo` gem to your `Gemfile`:

```ruby
gem 'mongo', '2.23.0'
```


## Connection Options

If you want to modify connection options or the connections pooling, you can
find all the information in the [official
documentation](https://www.mongodb.com/docs/mongoid/current/installation/).
find all the information in the [official documentation][mongoid-documentation].


## Mongo Ruby Driver Compatibility
Comment thread
benjaminach marked this conversation as resolved.
Outdated

Scalingo for MongoDB® supports MongoDB up to version `4.0.3`, the latest open
source version available.
Comment thread
benjaminach marked this conversation as resolved.
Outdated

The Mongo Ruby driver `mongo` version `2.24.0` removed support for MongoDB
Server `3.6` and `4.0`. As a consequence, **Ruby applications using MongoDB on
Scalingo must pin the `mongo` gem to version `2.23.0` or lower.**

For more information, see the [MongoDB Ruby Driver release notes][ruby-driver-release-notes].

[ruby-driver-release-notes]: https://www.mongodb.com/docs/ruby-driver/current/reference/release-notes/#std-label-ruby-version-2.23
[mongoid-documentation]: https://www.mongodb.com/docs/mongoid/current/