Filter arrays of objects using MongoDB-like query operators. Version 0.1.9. Part of the Phenyl framework, it supports operators such as $and, $or, $nor, $regex, $gte, $in, $exists, and many more. The query format is compatible with MongoDB's query operators, allowing complex filtering with nested field paths (e.g., 'foo.bar[0].baz'). It provides a lightweight, zero-dependency solution for in-memory filtering. Compared to similar libraries like 'mingo' or 'sift', power-filter is focused on simplicity and TypeScript/Flow support via the 'mongolike-operations' module.
npm install power-filterNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Imports the filter function and uses it to filter an array of objects with $or, $gte, and $regex operators.
Do not use $where. Use $expr or other operators instead, or implement custom filtering.
Do not use geospatial operators. They are not implemented.
Use $regex with a RegExp object that includes flags, or use $options as a string (e.g., { $regex: 'pattern', $options: 'i' }).Run 'npm install power-filter' (or 'yarn add power-filter'). Ensure you are using 'import { filter } from 'power-filter' (not default import).Use 'import { filter } from 'power-filter' (curly braces) instead of 'import filter from 'power-filter'.Use 'const { filter } = require('power-filter')' (destructure) instead of 'const filter = require('power-filter')'.No dependency data recorded yet.