Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Mongo 3 + Mongoid 5 Compatibility

オープン
#2 コメント 25 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
mongodb, ruby
領域
databases

調査の方向性

現在の master にある Mongo 2 の truncation mixin から始め、ここで説明されている Mongo 3 のアプローチとその collection lookup を比較してください。Mongo 2 と Mongoid 5 の互換性をどのように共存させるべきかを判断するため、pull request #343 と #349、issue #386、および参照されている commit を確認してください。Mongo 3 と Mongoid 5 の組み合わせが Mongo 2 のサポートを壊さずに動作すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

The pull request from DatabaseCleaner/database_cleaner#343 fixes compatibility with Mongo 3 but doesn't address the problem of Mongo 3 + Mongoid 5.

In the current master, the Mongo 2 truncation mixin contains this:

database['system.namespaces'].find(:name => { '$not' => /\.system\.|\$/ }).to_a.map do |collection|
  _, name = collection['name'].split('.', 2)
  name
end

And this commit won't work with mongo v3. Instead, I've found this to work:

session.command(listCollections: 1).first[:cursor][:firstBatch].map do |collection|
    collection[:name]
...

Plus, you also need the sessions function, also excluded:

def session
  ::Mongoid.default_session
end

But that won't work with Mongo 2 I don't believe.

What is the plan for Mongo3 - do you want me to merge this in to a separate module or have you already dealt with?

It seems this has been covered but not for Mongoid 5.

https://github.com/DatabaseCleaner/database_cleaner/pull/343
https://github.com/DatabaseCleaner/database_cleaner/pull/349
https://github.com/andreale/database_cleaner/commit/e9b2c8cd5d335006b8a59e2a89cdbd3fb9e5a23d
https://github.com/DatabaseCleaner/database_cleaner/issues/386

主要言語
Ruby
スター
9
フォーク
7
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

DatabaseCleaner/database_cleaner-mongoid のほかの issue

DatabaseCleaner/database_cleaner-mongoid の issue をすべて見る

似ている issue

Ruby の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。