Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update MongoDB driver #2200

Open
20 of 37 tasks
WebFreak001 opened this issue Aug 14, 2018 · 2 comments
Open
20 of 37 tasks

update MongoDB driver #2200

WebFreak001 opened this issue Aug 14, 2018 · 2 comments

Comments

@WebFreak001
Copy link
Contributor

WebFreak001 commented Aug 14, 2018

as per current "next gen driver" spec the current things are or are not (properly) implemented:

  • BSON
  • SCRAM-SHA-1, though missing:
    • authentication handshake (isMaster) + mechanism negotiation
    • username in x509 authentication is optional since 3.4, it's not erroring on missing username in 3.2 or earlier either
    • scram-sha-256 since 4.0 should be implemented for the future
  • SSL
  • Server Discovery and Monitoring
  • Server Selection
  • Max Staleness - A client (driver or mongos) MUST estimate the staleness of each secondary, based on lastWriteDate values provided in server isMaster responses, and select only those secondaries whose staleness is less than or equal to maxStalenessSeconds.
  • Read and Write Concern - A driver must support configuring and sending read concern and write concerns to a server.
  • Decimal Data Type - MongoDB 3.4 introduces a new BSON type representing high precision decimal ("\x13"), known as Decimal128
  • MongoDB Handshake - The isMaster handshake MUST be performed on every socket to any and all servers upon establishing the connection to MongoDB, including reconnects of dropped connections and newly discovered members of a cluster. It MUST be the first command sent over the respective socket. If the command fails the client MUST disconnect.
  • Collation - As of MongoDB server version 3.4 (maxWireVersion 5), a collation option is supported by the query system for matching and sorting on language strings in a locale-aware fashion
  • OP_MSG - OP_MSG is a bi-directional wire protocol opcode introduced in MongoDB 3.6 with the goal of replacing most existing opcodes, merging their use into one extendable opcode. OP_MSG is only available in MongoDB 3.6 (maxWireVersion >= 6) and later. MongoDB drivers MUST continue to perform the MongoDB Handshake using OP_QUERY to determine if the node supports OP_MSG.
  • Transactions - The API for transactions must be specified to ensure that all drivers and the mongo shell are consistent with each other, and to provide a natural interface for application developers and DBAs who use multi-statement transactions.
  • Connection String
  • CRUD (programmer API spec) missing:
    • countDocuments (count is deprecated)
    • estimatedDocumentCount
    • discting missing options
    • find missing options (there are more options now, should be put into a struct)
    • bulkWrite
    • insertOne (like insert, but id must be generated), insertMany (ids must be generated, must not use OP_INSERT) - insert wrappers
    • deleteOne, deleteMany (delete wrappers)
    • replaceOne, updateOne, updateMany (update wrappers)
    • findOneAndDelete, findOneAndReplace, findOneAndUpdate (wrappers of findAndModify)
  • Index Management (only old ensureIndex, no geo index for example)
  • Find, getMore and killCursors commands (still using opcodes)
  • Logical Sessions (for replica sets and shared clusters)
  • Retryable Writes
  • Causally Consistent Reads - A property that guarantees that an application can read its own writes and that a later read will never observe a version of the data that is older than an earlier read.
  • Enumerate Databases (optional)
  • OP_QUERY, OP_GET_MORE, OP_KILL_CURSOR, OP_REPLY
  • OP_INSERT, OP_UPDATE, OP_REMOVE, getLastError

we should think about supporting these draft specs:

  • Initial DNS Seedlist Discovery
  • Enumerate Collections

additionally we currently check if server connections satisfy a specific wire version to determine if we can run specific new commands on them, however with connection pooling across multiple servers this could break, as we just pick a random server, test its version and then run a command which may be run on another server. So:

  • fix satisfiesVersion here

imo before 1.0.0 MongoDB drivers should either be production ready or separated into a separate updated module. Note that this table may not be entirely accurate as I have only looked at a few parts in detail and noticed lots of missing parts.

@Geod24
Copy link
Contributor

Geod24 commented Oct 18, 2022

OP_UPDATE is still being used, I just hit this trying to get the dub registry working.

send(OpCode.Update, -1, cast(int)0, collection_name, cast(int)flags, selector, update);

@WebFreak001
Copy link
Contributor Author

@Geod24 fix is here: #2691

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants