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

https://github.com/sahilpohare/ex_sift

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

Upvote1Downvote0Go to commentsShare

Most Liked

mindreframer

mindreframer

Where Next?

Popular in Announcing Top

sasajuric
I’d like to announce a small library called boundaries. This is an experimental project which explores the idea of enforcing boundaries ...
New
OvermindDL1
I created a new library (rather I pulled out a couple files from my big project), it manages an operating system PID file for the BEAM. ...
New
josevalim
Yes, yet another parser combinator library! Most of the parser combinators in the ecosystem are either compile-time, often using AST tra...
159 19483 141
New
Crowdhailer
The latest release of Ace (0.10.0) includes serving content over HTTP/2. I have started writing a webserver to teach my self more about...
New
josevalim
EDIT: since Ecto 3.0 final version is out, this post was amended to use the final versions in the instructions below. Hi everyone, We a...
New
woutdp
Hi! I wanted to introduce my latest project LiveSvelte. It allows you to render Svelte inside LiveView with end-to-end reactivity. It’s ...
New
kip
ex_cldr provides localisation and internationalisation support based upon the data from the Unicode CLDR project. Unicode released CLDR ...
407 13056 120
New
type1fool
WebAuthnLiveComponent WebAuthnComponents See this post about renaming the package. Passwordless authentication for Phoenix LiveView app...
New
sbs
Only 650 LOC, wrote for fun :slight_smile: https://github.com/sunboshan/qrcode
New
ahamez
Hi everyone, I’ve been working on this protobuf library for 3 years. We use it in the company I work for, EasyMile, to communicate with ...
New

Other popular topics Top

WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I forese...
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 43657 311
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
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New

We're in Beta

About us Mission Statement