Skip to content

Commit

Permalink
MONGOID-5019 note that _id is only assigned for top-level documents (#…
Browse files Browse the repository at this point in the history
…4933)

Co-authored-by: Oleg Pudeyev <[email protected]>
  • Loading branch information
p-mongo and p authored Dec 7, 2020
1 parent 9a107d0 commit 030aded
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/tutorials/mongoid-documents.txt
Original file line number Diff line number Diff line change
Expand Up @@ -834,8 +834,10 @@ It is possible to omit the default entirely:

If the default on ``_id`` is omitted, and no ``_id`` value is provided by
your application, Mongoid will persist the document without the ``_id``
value and one will be assigned by the server. However, Mongoid will
not automatically retrieve this value when the document is persisted - you
value. In this case, if the document is a top-level document, an ``_id``
value will be assigned by the server; if the document is an embedded document,
no ``_id`` value will be assigned. Mongoid will not automatically retrieve
this value, if assigned, when the document is persisted - you
must obtain the persisted value (and the complete persisted document) using
other means:

Expand Down

0 comments on commit 030aded

Please sign in to comment.