KtMongo 0.19.0 is out! - Multiplatform `ObjectId...
# feed
c
KtMongo 0.19.0 is out! • Multiplatform
ObjectId
and
Timestamp
• Support for
kotlin.time.Instant
• Added the operators
$switch
,
$type
,
$isNumber
, `$isArray`…,
$bitsAllClear
, `$bitsAnyClear`… • Added the options `writeConcern`and
readPreference
https://opensavvy.gitlab.io/ktmongo/docs#C078Z1QRHL3
👍 4
🔥 6
👍🏾 1
j
adoption is on my todo list!
👀 1
s
Are there any plans to make it Kotlin/Native? It would be great to interact with a MongoDB database from a Kotlin/Native AWS Lambda or a WASM-based Cloudflare Worker.
c
There are, but don't expect anything for a year at least. (unless more contributors help?) Current progress: • The BSON data types are mostly multiplatform, only a few tricky types are missing (mainly
Decimal128
, but also the deprecated
DbPointer
).
ObjectId
,
Timestamp
,
BsonDocument
,
BsonArray
etc are all multiplatform currently. • The BSON encoder/decoder has the same amount of progress as the data types. Notably, the decoder is 0-copy (it doesn't use more memory than the binary representation of the request, except some lightweight temporary objects) and lazy (it can skip over entire subdocuments if the user doesn't care about their contents). The encoder is streaming and doesn't need an intermediary representation (it's straight from your objects to the final binary representation). • There is no multiplatform KotlinX.Serialization support for now. • The DSL (all operators) is not compiled for non-JVM platforms for now, but it's pure Kotlin code except for the yet-unsupported data types mentioned above. • After that, the main difficult part is the socket protocol to actually send the sockets to the database. This is not started yet but I've got a few ideas of how to make that quite fast. Of course, this will be entirely coroutine-powered with no blocking I/O.
s
Sounds good. Thank you for the update. 🙂
c
Don't hesitate to follow the project in #C078Z1QRHL3 😉
If you have an existing codebase that uses MongoDB, I'm searching for beta-testers to give feedback on some APIs
👍 1