(btw the official Java & Kotlin drivers have the same problem)
I'm a bit stuck, because I want to display JSON to users, but the specified JSON is a valid two-way equivalent to the query :/
See how there's a $regularExpression object that appeared out of nowhere?
This is the official JSON equivalent. But it's not recognized by MongoDB editors. So if you copy-paste it there, it sends the full structure to MongoDB, which is not one of the valid syntaxes.
Note how the native type is writte: /pattern/<options>.
This isn't actually MongoDB syntax, it's JS! If you're not using JS, that's not legal for you.
Worst, this is *not* how the RegExp BSON type is specified to be rendered to JSON. Here it is:
github.com/mongodb/spec...
This happens because of the JSON conversion rules of native BSON types.
For example, with RegExp.
The query operator $regex accepts three syntaxes. Two that takes strings, and one that accepts a BSON RegExp type.
www.mongodb.com/docs/manual/...
With KtMongo, I strive to:
• Each KtMongo class should have a toString() that shows what you need to copy-paste into a MongoDB editor to make the same query
• The toString() should follow the BSON specification
Turns out, these two points are incompatible!
#mongodb
👀
With that, links in module pages are now finally resolved correctly.
Finally managed to get the Dokka aggregation plugin to work!
This will break all existing URLs, but that's why the project is marked experimental.
Before:
/api/-mongo-d-b%20request%20-d-s-l/opensavvy.ktmongo.dsl/-bson-context.html
After:
/api/dsl/opensavvy.ktmongo.dsl/-bson-context.html
I'm making big progress in the Dokka Material MkDocs integration 👀
(yes it says error in the sitemap, but in the sitemap's page it says success)
Google still doesn't think it's worth indexing though
The peak around the 3rd is. The big one is the mandatory varargs one.
ah. That's not good.
Okay I guess people prefer shorter articles 😅
The cache usage of GitLab CI runners is insane.
I just cleared 250 GB of storage from 8 days of CI execution!
New article!
Did you know #Kotlin has mandatory varargs?
ivan.canet.dev/blog/2026/03...
Having talked to a few teachers, the secret seems to be ‘have all the grades be based on oral exams’.
Maybe they can't write the code, but if they can understand what the LLM wrote, that's still a skill.
Technically not, but it's very useful as ‘recursive navigate to usage’
My favorite is ‘data flow to here’ which isn't even in this popup
(note also that in the Kotlin version, the argument to the lambda is implicit for these methods, this is another language feature: these are extension lambdas, not regular ones, which implicitly expose the instance they're called on)
Together, these features allow very expressive and concise DSLs
In Rust, this would look like
let retry = pipeline.job(build, |job| {
job.script(|script| {
script.shell("...");
});
job.retry(2, |reason| {
reason.onExitCode(127);
});
});
(Sorry if it's not exact, I haven't written Rust in a while)
Other people have already answered the questions, but I wanted to share an example of how it looks like in practice
Each call is a function + the lambda it receives, it's very convenient to concisely describe complex structures (here, GitLab CI config instead of YAML)
Like, Git isn't a blockchain, but it's decentralized and there's an append-only ledger, so if I were mandated to use blockchain tools just because it's the hype, then I'd claim Git counts
I wish we had nice well-defined terms to talk about stuff, but I also much prefer branding a feature that works as the buzzword-of-the-moment than actually having it be rewritten as a worse version using an unrelated tech just because it's in the hyper circle
It is also a way of riding the hype. If rebranding an existing feature as ‘AI’ even though it's just a basic predictive algorithm makes it sell more and makes the clients happy...
Okayyy, I get it
Challenge for people who believe Claude *is* conscious and use it anyway: Explain how you’re not a slaver.
I'm nominated in ‘online presence’, vote for me!