lib/mongoid/contextual/memory.rb
# Delete all documents in the database that match the selector.
#
# @example Delete all the documents.
#   context.delete
#
# @return [ nil ] Nil.
#
# @since 3.0.0
Delete all documents in the database that match the selector.
Delete all documents in the database that match the selector .
def delete
        deleted = count
        removed = map do |doc|
          prepare_remove(doc)
          doc.as_document
        end
        unless removed.empty?
          collection.find(selector).update("$pullAll" => { path => removed })
        end
        deleted
      end
def delete deleted = count removed = map do | doc | prepare_remove ( doc ) doc . as_document end unless removed . empty? collection . find ( selector ) . update ( "$pullAll" => { path => removed } ) end deleted end
Delete all documents in the database that match the selector.
Delete all documents in the database that match the selector .
None
 nil 
example
Delete all the documents. context.delete
Delete all the documents . context . delete
since
None