From 030aded2c0f4bcc6d030a183fe84dc5208e5f600 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev <39304720+p-mongo@users.noreply.github.com> Date: Mon, 7 Dec 2020 10:50:42 -0500 Subject: [PATCH] MONGOID-5019 note that _id is only assigned for top-level documents (#4933) Co-authored-by: Oleg Pudeyev --- docs/tutorials/mongoid-documents.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/tutorials/mongoid-documents.txt b/docs/tutorials/mongoid-documents.txt index fb7308a995..2b57529010 100644 --- a/docs/tutorials/mongoid-documents.txt +++ b/docs/tutorials/mongoid-documents.txt @@ -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: