[DOCS-7489] Modern drivers use write commands instead of OP_INSERT, OP_UPDATE, and OP_DELETE + getLastError Created: 22/Mar/16  Updated: 11/Jan/17  Resolved: 22/Apr/16

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: 01112017-cleanup

Type: Improvement Priority: Major - P3
Reporter: A. Jesse Jiryu Davis Assignee: Ravind Kumar (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 7 years, 42 weeks, 5 days ago

 Description   

This page:

https://docs.mongodb.org/manual/reference/mongodb-wire-protocol/#wp-request-opcodes

should mention that, starting with MongoDB 2.6 and maxWireVersion 3, modern drivers use write commands for acknowledged writes, instead of OP_INSERT, OP_UPDATE, and OP_DELETE + getLastError. The legacy op codes are not exactly "deprecated" since they are not scheduled for removal, and most drivers will use them for unacknowledged writes. But they are "legacy" or "old-fashioned".



 Comments   
Comment by Githook User [ 22/Apr/16 ]

Author:

{u'username': u'rkumar-mongo', u'name': u'ravind', u'email': u'ravind.kumar@10gen.com'}

Message: DOCS-7489: modern drivers use dbcommands instead of opcodes for acknowledged writes

Signed-off-by: kay <kay.kim@10gen.com>
Branch: v3.0
https://github.com/mongodb/docs/commit/8cd326fe3049189d73490dfa8418eb9d853623f8

Comment by Githook User [ 22/Apr/16 ]

Author:

{u'username': u'rkumar-mongo', u'name': u'ravind', u'email': u'ravind.kumar@10gen.com'}

Message: DOCS-7489: modern drivers use dbcommands instead of opcodes for acknowledged writes

Signed-off-by: kay <kay.kim@10gen.com>
Branch: master
https://github.com/mongodb/docs/commit/d44e7b3672139ef281c5a9f0e31fc8a0369186c6

Comment by A. Jesse Jiryu Davis [ 30/Mar/16 ]

Exactly. If in Python you do "collection.insert(doc)", it no longer sends OP_INSERT and getLastError to the server, instead it sends

{insert: "collection", documents: [ { ... } ] }

A third-party driver author pointed out to me on Twitter that you can't tell, from reading our wire protocol documentation, that the legacy opcodes are deprecated:

https://twitter.com/rit/status/712335361708429312

Generated at Thu Feb 08 07:54:23 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.