Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit eabde02

Browse files
committed
JT tech review 1
1 parent 5b95358 commit eabde02

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

‎docs/eloquent-models/model-class.txt‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,10 @@ MongoDB.
297297
When you apply the ``DocumentModel`` trait to a model class, you must
298298
declare the following properties in your class:
299299

300-
- ``$primaryKey``: Defines the field that uniquely identifies a MongoDB document
301-
- ``$keyType``: Defines the type of the primary key value
300+
- ``$primaryKey = '_id'``, because the ``_id`` field uniquely
301+
identifies MongoDB documents
302+
- ``$keyType = 'string'``, because {+odm-short+} casts MongoDB
303+
``ObjectId`` values to type ``string``
302304

303305
Extended Class Example
304306
~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /