From 14b3b3f553a93f5e4a9e4ebab500268faef41c23 Mon Sep 17 00:00:00 2001 From: rustagir Date: Tue, 23 Jul 2024 10:15:46 -0400 Subject: [PATCH] JT tech review 1 --- docs/eloquent-models/model-class.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/eloquent-models/model-class.txt b/docs/eloquent-models/model-class.txt index 2ae470b1c..9d38fe1a7 100644 --- a/docs/eloquent-models/model-class.txt +++ b/docs/eloquent-models/model-class.txt @@ -297,8 +297,10 @@ MongoDB. When you apply the ``DocumentModel`` trait to a model class, you must declare the following properties in your class: -- ``$primaryKey``: Defines the field that uniquely identifies a MongoDB document -- ``$keyType``: Defines the type of the primary key value +- ``$primaryKey = '_id'``, because the ``_id`` field uniquely + identifies MongoDB documents +- ``$keyType = 'string'``, because {+odm-short+} casts MongoDB + ``ObjectId`` values to type ``string`` Extended Class Example ~~~~~~~~~~~~~~~~~~~~~~