Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
database_cleaner-mongoid
Advanced tools
Clean your Mongoid databases with Database Cleaner.
See https://github.com/DatabaseCleaner/database_cleaner for more information.
# Gemfile
group :test do
gem 'database_cleaner-mongoid'
end
The mongoid adapter only has one strategy: the deletion strategy.
:only
and :except
may take a list of collection names:
# Only delete the "users" collection.
DatabaseCleaner[:mongoid].strategy = :deletion, { only: ["users"] }
# Delete all collections except the "users" collection.
DatabaseCleaner[:mongoid].strategy = :deletion, { except: ["users"] }
#db
defaults to the default Mongoid database, but can be specified manually in a few ways:
# Redis URI string:
DatabaseCleaner[:mongoid].db = :logs
# Back to default:
DatabaseCleaner[:mongoid].db = :default
# Multiple Mongoid databases can be specified:
DatabaseCleaner[:mongoid, connection: :default]
DatabaseCleaner[:mongoid, connection: :shard_1]
DatabaseCleaner[:mongoid, connection: :shard_2]
See LICENSE for details.
FAQs
Unknown package
We found that database_cleaner-mongoid demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.