3.1.1. Transform plain JavaScript objects into MongoDB update instruction objects with dot-notation paths. Supports all standard MongoDB update operators ($set, $inc, $push, $unset, $currentDate, etc.), array flattening, and positional operators ($, $[], $[identifier]). No runtime dependency on the mongo driver. Written in TypeScript with bundled type definitions. Frequently updated with CI and high test coverage.
npm install mongo-dot-notationNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates using flatten with operators $inc, $push, and $unset.
Use `import { flatten } from 'mongo-dot-notation'` or CommonJS `const { flatten } = require('mongo-dot-notation')`.Use `{ array: true }` instead of `{ object: true }`.Pass `{ array: true }` to flatten to convert array indices into dot notation.Use `$inc(amount)` instead of `$inc` alone.
Use nested positional operator syntax like `$('field')` or `$('[].field')`.Change to `import { flatten } from 'mongo-dot-notation'`.Use `$inc(amount)` to create a valid operator object.
Use `flatten()` output only with MongoDB update operations (updateOne, updateMany, findOneAndUpdate, etc.).
No dependency data recorded yet.