Skip to content

Commit bab484b

Browse files
Merge pull request #35 from ianf-mongodb/DOCSP-28021
DOCSP-28021 Update Key Handeling Project Settings
2 parents 7c797fd + ebbcbd3 commit bab484b

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

source/projects/configure-settings.txt

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,19 @@ Key Handling Options
4242
Specifies how the ``_id`` field is populated when new documents are
4343
inserted into a collection. You can choose one of the following options:
4444

45-
- :guilabel:`Wrapped Inherited Primary Key`
45+
- :guilabel:`Autogenerated ObjectId`
4646

47-
- Your ``_id`` field is populated with an object where the key is the
48-
name of your primary key field and the value is the value of your
49-
primary key field.
47+
- Your ``_id`` field is populated with an autogenerated random
48+
:ref:`ObjectId <document-bson-type-object-id>`.
5049

51-
For example, if your relational table row has a primary key of
52-
``personId = 1``, after migration your MongoDB ``_id``field is
53-
``_id: { personId: 1 }``.
50+
``Autogenered ObjectId`` is the default key handling strategy used
51+
when creating a new project.
5452

53+
You may choose to keep the original primary key as a different field
54+
in the collection.
55+
56+
For example, if your relational table row has a primary key of ``personId = 1``,
57+
after migration your MongoDB ``_id`` field is ``_id: ObjectId("62472f3d5849820a91d7b52f")``.
5558

5659
- :guilabel:`Single Inherited Primary Key`
5760

@@ -61,17 +64,16 @@ inserted into a collection. You can choose one of the following options:
6164
For example, if your relational table row has a primary key of ``personId=1``,
6265
after migration your MongoDB ``_id`` field is ``_id: 1``.
6366

67+
- :guilabel:`Wrapped Inherited Primary Key`
6468

65-
- :guilabel:`Autogenerated ObjectId`
66-
67-
- Your ``_id`` field is populated with an autogenerated random
68-
`ObjectId <https://www.mongodb.com/docs/manual/reference/bson-types/#std-label-objectid>`__.
69+
- Your ``_id`` field is populated with an object where the key is the
70+
name of your primary key field and the value is the value of your
71+
primary key field.
6972

70-
You may choose to keep the original primary key as a different field
71-
in the collection.
73+
For example, if your relational table row has a primary key of
74+
``personId = 1``, after migration your MongoDB ``_id``field is
75+
``_id: { personId: 1 }``.
7276

73-
For example, if your relational table row has a primary key of ``personId = 1``,
74-
after migration your MongoDB ``_id`` field is ``_id: ObjectId("62472f3d5849820a91d7b52f")``.
7577

7678
Key Handling Behavior
7779
`````````````````````

0 commit comments

Comments
 (0)