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

ityonemo
Currently just starting out on a new mini-project - getting zig NIFs to run in elixir. https://github.com/ityonemo/zigler The idea here...
New
BartOtten
This powerful library works together with Phoenix Router to provide the ultimate routing solution. It simplifies route manipulation, givi...
New
restlessronin
The repo is at GitHub - cyberchitta/openai_ex: Community maintained Elixir library for OpenAI API. Docs are at OpenaiEx User Guide — ope...
New
New
lud
Hello! I’ve been working on the Oaskit library for a while now, and just released a first version. Since I’ve built JSV I wanted to be ...
New
lostbean
Hello Elixir community! :wave: I’m excited to announce the first release of ReqCassette, a VCR-style record-and-replay library specifica...
New
mindreframer
ElixirProto: Protobuf-Inspired Serialization for Elixir Events I wanted to have an Elixir-native serialization for events, that also supp...
New
type1fool
WebAuthnLiveComponent WebAuthnComponents See this post about renaming the package. Passwordless authentication for Phoenix LiveView app...
New
leandrocp
MDEx is a fast and extensible Markdown parser and formatter. Fast Leverage Rust to parse, manipulate and render documents using: comra...
New
mattmower
I’m pleased to announce that we’ve released DemoGen v0.1.7, a library for creating repeatable demo scenarios in your Ecto-based SaaS appl...
New

Other popular topics Top

joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 record...
New
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
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
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
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
josevalim
Hi everyone, One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
273 38985 115
New

We're in Beta

About us Mission Statement