lib/mongoid/persistence.rb
# Create a new document. This will instantiate a new document and
# insert it in a single call. Will always return the document
# whether save passed or not.
#
# @example Create a new document.
#   Person.create(:title => "Mr")
#
# @param [ Hash ] attributes The attributes to create with.
# @param [ Hash ] options A mass-assignment protection options. Supports
#   :as and :without_protection
#
# @return [ Document ] The newly created document.
Create a new document. This will instantiate a new document and
insert it in a single call. Will always return the document
whether save passed or not.
Create a new document . This will instantiate a new document and insert it in a single call . Will always return the document whether save passed or not .
def create(attributes = {}, options = {}, &block)
        _creating do
          doc = new(attributes, options, &block)
          doc.save
          doc
        end
      end
def create ( attributes = { } , options = { } , & block ) _creating do doc = new ( attributes , options , & block ) doc . save doc end end
Create a new document.
Create a new document .
The newly created document.
The newly created document .
 Document 
attributes
<not_specific>
options
<not_specific>
block
<not_specific>
<not_specific>
options A mass-assignment protection options. Supports :as and :without_protection
options A mass - assignment protection options . Supports : as and : without_protection
example
Create a new document. Person.create(:title => "Mr")
Create a new document . Person . create ( : title = > " Mr " )