lib/mongoid/config.rb
# Truncate all data in all collections, but not the indexes.
#
# @example Truncate all collection data.
#   Mongoid::Config.truncate!
#
# @note This will be slower than purge!
#
# @return [ true ] true.
Truncate all data in all collections, but not the indexes.
Truncate all data in all collections but not the indexes .
def truncate!
      global_client.database.collections.each do |collection|
        collection.find.delete_many
      end and true
    end
def truncate! global_client . database . collections . each do | collection | collection . find . delete_many end and true end
Truncate all data in all collections, but not the indexes.
Truncate all data in all collections but not the indexes .
None
 true 
example
Truncate all collection data. Mongoid::Config.truncate!
Truncate all collection data . Mongoid :: Config . truncate!
note
This will be slower than purge!
This will be slower than purge!