cheekyfinder

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

I’d love to hear your feedback and see how you use it! I’m open to contributions :rocket:

Upvote1Downvote0Go to commentsShare

First Post!

mindreframer

mindreframer

there is also this:

GitHub - botsquad/match_engine: In-memory matching/filtering engine with Mongo-like query syntax.

looks quite similar, though not exactly same.

Where Next?

Popular in Announcing Top

hauleth
PhoenixBakery is library for Phoenix 1.6 (and later) that provides modules implementing Phoenix.Digester.Compressor. There are currently ...
New
ananthakumaran
An ExUnit formatter to visualize test execution and find bottlenecks in your test suite. I created a small library called ex_unit_spa...
New
phcurado
Zoi is a new schema validation library for Elixir. It’s inspired by Zod from the JavaScript ecosystem, bringing a similar functional API...
New
rahultumpala
Hello Elixir community, I work primarily on Java and other object oriented programming languages and often found it difficult to read an...
New
hauleth
It is library created by me and @abc3. It is simple client for DuckDB, but with small twist when compared with other libraries out there ...
New
zteln
Hello Elixir community, I’ve written a small embedded key-value database in Elixir called Goblin. It’s based on the Log-Structured Merge...
New
rbino
Hey folks! I’m happy to introduce TigerBeetlex, an Elixir client for TigerBeetle, the financial transactions database. I’ve been working...
New
munksgaard
flakify is an igniter installer that allows you to quickly get a Nix flake-based development shell up and running for your Elixir/Phoenix...
New
victor23k
LiveViewPortal is a small library that allows third-party sites to embed LiveView apps. The library is distributed as an NPM package. On...
New
aesmail
Hello guys, I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New

Other popular topics Top

jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 49522 488
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
mgjohns61585
Could someone help me? I'm making my first elixir program, number guessing game. I can't figure out how to convert the user's guess from ...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
aesmail
Hello guys, I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New

We're in Beta

About us Mission Statement