Poco::MongoDB support for MongoDB 5.0?
The MongoDB wire protocol opcodes used by the POCO MongoDB driver have been deprecated in MongoDB 5.0 (see [https://docs.mongodb.com/manual/reference/mongodb-wire-protocol/#std-label-wp-request-opcodes]). I stumbled across this when attempting to use Poco::MongoDB::InsertRequest to insert a document into a MongoDB 5.0 "time series" collection and it failed to work. These legacy opcodes have been replaced by the OP_MSG opcode introduced in MongoDB 3.6 with the associated wire transfer request and response changes.
Is the migration of the MongoDB driver from using legacy to modern protocols somewhere in the POCO roadmap?
I guess it will have to be done at some point. Contributions welcome.
@matejk could you help with this?
@aleks-f, we will transition to newer Linux distributions until end of this year and we'll also need this. Yes, I can help.
Relevant obsolescence page:
https://www.mongodb.com/docs/manual/reference/mongodb-wire-protocol/#legacy-opcodes
Mongo DB introduced OP_MSG that replaces other messages in version 3.6, current version is 6.0.
Versions older than 3.6 are not supported anymore.
@aleks-f, is it expected that Poco::MongoDB shall support legacy versions of MongoDB, older than 3.6?
If not, then legacy wire messages can be completely replaced with new wire protocol.
I don't know
@obiltschnig @fbraem ?
I started to work on this feature in the way that both old and new wire protocol are supported.
I had planned to work on this as part of a project, but that project got postponed indefinitely unfortunately.
First batch of changes is available on branch
https://github.com/matejk/poco/tree/gh-3484-mongodb-op_msg
in case that someone in interested in providing early feedback.
Required functionality to support MongoDB 5.1 and newer is available on branch:
https://github.com/matejk/poco/tree/gh-3484-mongodb-op_msg
I tested it with MongoDB 6.0.
@obiltschnig , @fbraem: IMO it would be great if someone would take a look at the code and try it before I create a merge request.