MongoDB-style object operators for array manipulation: where (filter), order (sort), update (transform), and view (project). v1.0.0 stable, published under MIT. Provides MongoDB-like query selectors ($gt, $in, $or, $exists, etc.), sort parameters, and update operators ($set, $inc, $push) as standalone functions that can be used directly on arrays or passed to Array.filter, Array.sort, Array.forEach. Supports ESM, CommonJS, and browser builds (unpkg/CDN). Differentiator: lightweight (<5KB gzip), zero dependencies, and familiar MongoDB API for anyone transitioning from backend to frontend.
npm install obopNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Filter, sort, and update an array of objects using MongoDB-style operators with obop.
Use const obop = require('obop')(); or import obop from 'obop'.Ensure you intend to mutate or use a shallow copy before calling update: const copy = array.map(o => ({...o})); obop.update(copy, updateSpec);Use {field: {$gt: 10, $lt: 20}} instead of nesting under a single operator.Ensure query is a valid JavaScript object. For empty query, use {}.Use const obop = require('obop')(); or import obop from 'obop'.Use import obop from 'obop' then obop.where(...).
Use obop = require('obop')(); or obop = obopInit(); from ESM default.No dependency data recorded yet.