Kirlovon / aloedb

Light, Embeddable, NoSQL database for Deno 🦕
https://deno.land/x/aloedb
MIT License
140 stars 12 forks source link

Sort #20

Closed gaggle closed 1 year ago

gaggle commented 1 year ago

Nice library, thanks for making it available!

For what it's worth I went in assuming e.g. findMany would support some sort of sorting (I don't say this as a complaint, merely to highlight my "new user assumption"). So I'm currently wrapping Aloe find methods to allow my implementations to do things like (await db.findMany()).sort(sorter).

I'm not sure sorting fits your vision, but if it does then I could see built-in sorting working well with #8 to be able to select a subset of documents along a certain key, e.g. db.findMany().sort({created_at: 1}).limit(10) (kind of Mongo inspired syntax).