Skip to content

Composite sorted indexes? #3

@julienfantin

Description

@julienfantin

Let's say we added a :gender key to every user from the README:

[{:name "Alice", :age 42, :gender :f}
 {:name "Bob", :age 30, :gender :m}
 {:name "Barbara", :age 12, :gender :f}
 {:name "Jim", :age 83, :gender :m}]

A query such as males over 30, could be answered efficiently with this kind of structure:

;; NOTE users are sorted within their gender group

{:f [{:name "Barbara", :age 12, :gender :f}
     {:name "Alice", :age 42, :gender :f}]
 :m [{:name "Bob", :age 30, :gender :m}
     {:name "Jim", :age 83, :gender :m}]}

But I couldn't quite figure out if this was supported in the current api?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions