cheekyfinder
ExSift - High-performance MongoDB-style query filtering for Elixir
ExSift: High-performance MongoDB-style query filtering for Elixir
I’m working on ExSift, a high-performance library that uses sift.js-inspired MongoDB-style query syntax to filter Elixir collections.
What is it?
ExSift uses a MongoDB’s declarative syntax to filter lists of maps or structs. When creating dynamic search APIs, rule engines, or intricate data filtering logic (such as memory-only data or API answers) when Ecto queries aren’t suitable, it’s ideal.
Key Features
-
MongoDB Syntax: Supports standard operators like
$eq,$gt,$in,$regex,$elemMatch,$and,$or, and many more. -
Nested Support: Deeply query nested maps and lists using dot notation (e.g.,
%{ "user.address.city" => "New York" }). -
High Performance: Recently optimized with a new compilation engine that pre-compiles queries into native Elixir function calls, resulting in a ~2.3x speedup over runtime interpretation.
-
Safe: Runs in pure Elixir, no external dependencies for the core logic.
Example
data = [
%{name: "Alice", age: 30, role: "admin"},
%{name: "Bob", age: 25, role: "user"},
%{name: "Charlie", age: 35, role: "user"}
]
query = %{
"role" => "user",
"age" => %{"$gt" => 20}
}
ExSift.filter(data, query)
# => [%{name: "Bob", ...}, %{name: "Charlie", ...}]
Links
- Hex: https://hex.pm/packages/ex_sift
- GitHub:
https://github.com/sahilpohare/ex_sift
I’d love to hear your feedback and see how you use it! I’m open to contributions ![]()
Upvote1Downvote0Go to commentsShare
Most Liked
mindreframer
there is also this:
looks quite similar, though not exactly same.
Popular in Announcing
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #hex









