You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Though drivers may expose configuration options to prevent this behavior, by default a new ``ObjectId`` value will be created client-side before an insert or upsert operation.
470
+
Though drivers may expose configuration options to prevent this behavior, by default a new ``ObjectId`` value will be created client-side before an ``insert`` operation.
471
471
472
472
This design decision primarily stems from the fact that MongoDB is a distributed database and the typical unique auto-incrementing scalar value most RDBMS' use for generating a primary key would not be robust enough, necessitating the need for a more robust data type (``ObjectId`` in this case). These ``_id`` values can be generated either on the client or the server, however when done client-side a new document's ``_id`` value is immediately available for use without the need for a network round trip.
473
473
@@ -477,10 +477,7 @@ Prior to MongoDB 3.6, an ``insert`` operation would use the ``OP_INSERT`` opcod
477
477
Can a driver still use the ``OP_INSERT``, ``OP_DELETE``, ``OP_UPDATE``?
Yes, a 2.6 server will still support those. But it is unlikely that a 2.8 server would. Of course, when talking to older servers, the usual op codes will continue working the same. An older server is one that reports ``hello.maxWireVersion`` to be less than 2 or does not include the field.
481
-
482
-
The rationale here is that we may choose to divert all the write traffic to the new
483
-
protocol. (This depends on the having the overhead to issue a batch with one item very low.)
480
+
The `legacy opcodes were removed in MongoDB 6.0 <https://www.mongodb.com/docs/manual/release-notes/6.0-compatibility/#legacy-opcodes-removed>`_. As of MongoDB 3.6 these opcodes were superseded by `OP_MSG <https://www.mongodb.com/docs/manual/reference/mongodb-wire-protocol/#op_msg>`_, however all server versions up until 6.0 continued to support the legacy opcodes.
484
481
485
482
486
483
Can an application still issue requests with write concerns {w: 0}?
@@ -505,7 +502,8 @@ Yes but as of 2.6 the existing getLastError behavior is supported for backward c
505
502
Changelog
506
503
---------
507
504
508
-
:2024-06-04: Add FAQ entry outlining client-side _id value generation
505
+
:2024-06-04: Add FAQ entry outlining client-side _id value generation
506
+
Update FAQ to indicate legacy opcodes were removed
509
507
:2022-10-05: Revise spec front matter and reformat changelog.
510
508
:2022-07-25: Remove outdated value for ``maxWriteBatchSize``
0 commit comments