Registry / database / mongo-query-match

mongo-query-match

JSON →
library2.0.0pypypi✓ verified 80d ago

A utility library that provides a MongoDB-like query language for querying Python collections, mainly intended for parsing objects structured as fundamental types (JSON/YAML). Current version: 2.0.0. Release cadence: irregular.

pip install mongo-query-match
INSTALL
IMPORT
SIG · MONGO-QUERY-MATCH
M
mongo-query-match
databasepythonv2.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Query
from mongoquery import Query
from mongo_query_match import query_match
Mapping
from mongoquery import Mapping
QueryError
from mongoquery import QueryError

Filter a list of dicts using MongoDB-like operators ($gt, $lt, $in, etc.).

from mongo_query_match import query_match # Sample data data = [ {"name": "Alice", "age": 30, "city": "NYC"}, {"name": "Bob", "age": 25, "city": "LA"}, ] # MongoDB-like query result = query_match(data, {"age": {"$gt": 26}}) print(list(result)) # [{'name': 'Alice', 'age': 30, 'city': 'NYC'}]
Debug
Known issues
breakingVersion 2.0.0 removed the old import path (from mongo_query_match import query). Use `query_match` instead.
fix
Change imports to `from mongo_query_match import query_match`.
affects: >=2.0.0
gotchaThe library expects input data as a list of dictionaries (or iterable). Passing a single dict will not work as expected; it iterates over dict keys.
fix
Ensure data is a list: `result = query_match([data], query)`.
affects: all
deprecatedThe `match` helper function (if available in older versions) is deprecated and may be removed.
fix
Use `query_match` instead.
affects: <2.0.0
gotchaOperators like `$regex` use Python re module; ensure patterns are valid Python regex. Escape backslashes appropriately.
fix
Use raw strings: `{"field": {"$regex": r"\d+"}}`.
affects: all
Upgrade
Version history
2.0.0latest on PyPI · released Feb 2, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
4
Amazon
1
Resources

No resource links recorded.

mongo-query-match — pip install mongo-query-match · libregistry