-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mongo 3 + Mongoid 5 Compatibility #2
Comments
Actually, Mongoid.default_session has been depreciated too and need to be replaced with: default_client Will test further. |
I'm getting this error with Mongoid 5: https://travis-ci.org/diowa/ruby2-rails4-bootstrap-heroku/builds/81394387#L313
|
+1
caused by database['system.namespaces'].find(:name => { '$not' => /\.system\.|\$/ }).to_a Edit: it seems that it's not related. I'm investigating. |
@fonji Would love to hear what you find. I keep running into that one too and my knowledge of MongoDB / Mongoid is not deep enough to investigate this issue. |
@vindia: sorry, I'm in a hurry and didn't find the cause in the time I allowed myself to investigate. |
@fonji Thanks! I think I will stick to Mongo 2.6 and Mongoid 4.0 for the time being. |
I have the same error of @fonji. anyone has a workaround for this issue? |
hello guys, test:
sessions:
default:
database: my_app_test
hosts:
- localhost:27017
options:
- read: primary
+ read:
+ mode: :primary
# In the test environment we lower the retries and retry interval to
# low amounts for fast failures.
max_retries: 1 Please let me know if this works for you :) |
thanks @sbounmy, I tried but still having the same issue. What happens with the "clients:" and "database:" keys?? |
ups, i've updated my last post. Are you sure you have correctly updated your mongoid.yml? |
Great! now with that configuratin is working. Thanks! |
That works, thanks! BTW, you can also leave the who |
I would also love to see Mongoid 5 compatibility 👍 |
I'm not a MongoidCleaner user but I ran into the same issue when upgrading to Mongoid 5. Changing the mongoid.yml config file worked for me:
|
@sbounmy thank you, it works for me! |
@sbounmy thank you for the hint! +1 for mongoid 5.0 dependency update |
Make "primary" a symbol ":primary" worked for me too. |
* fix DatabaseCleaner error, see https://github.com/DatabaseCleaner/database_cleaner/issues/392
it doesn't work for me.
|
version 1.5.1 works for me
sample repos: |
umm, although I upgraded these gems to the same version, but it doesn't work yet... |
In my case, |
I've resolved my problem! The problem is caused by using WiredTiger storage engine, default storage engine since 3.2. After I changed my mongo's configuration as follows, database_cleaner works. storage:
dbPath: /usr/local/var/mongoedb
engine: mmpav1 # <= Added So this means that database_cleaner doesn't work with wiredTiger, in other words v3.2 or newer of mongodb in default. |
@satoryu thanks for sharing this |
I'm using MongoDB v3.2.4 with mongoid-5.1.1, and database_cleaner-1.5.1. The cleaning doesn't seem to be working anymore. I'm not sure if it's due to the engine, so far I'm using the default. I tried to use Here's my
|
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:
And this commit won't work with mongo v3. Instead, I've found this to work:
Plus, you also need the sessions function, also excluded:
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.
DatabaseCleaner/database_cleaner#343
DatabaseCleaner/database_cleaner#349
andreale/database_cleaner@e9b2c8c
https://github.com/DatabaseCleaner/database_cleaner/issues/386
The text was updated successfully, but these errors were encountered: