Neat. When I migrated a project from mongo to postgres I took a similar approach, except I only implemented the mongo feel I needed within my own project instead of building a proper library as done here. I was surprised how much performance improved despite using a hacky wrapper.
https://blog.stuartspence.ca/2023-05-goodbye-mongo.html
Personally tho, I plan to just drop all similarity to mongo in future projects.