Skip to content

Commit 71a9118

Browse files
alexbevialcaeus
andauthored
Update FAQ to indicate legacy opcodes were removed (#1593)
* Update FAQ to indicate legacy opcodes were removed * Clarify usage of legacy opcodes * Update source/server_write_commands.rst Co-authored-by: Andreas Braun <[email protected]> --------- Co-authored-by: Andreas Braun <[email protected]>
1 parent 9bfa512 commit 71a9118

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

source/server_write_commands.rst

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ FAQ
467467
Why are ``_id`` values generated client-side by default for new documents?
468468
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
469469

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 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.
471471

472472
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.
473473

@@ -477,10 +477,7 @@ Prior to MongoDB 3.6, an ``insert`` operation would use the ``OP_INSERT`` opcod
477477
Can a driver still use the ``OP_INSERT``, ``OP_DELETE``, ``OP_UPDATE``?
478478
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
479479

480-
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.
484481

485482

486483
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
505502
Changelog
506503
---------
507504

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
509507
:2022-10-05: Revise spec front matter and reformat changelog.
510508
:2022-07-25: Remove outdated value for ``maxWriteBatchSize``
511509
:2021-04-22: Updated to use hello command

0 commit comments

Comments
 (0)