- Update
mongojs
to newest version, which includes various bug fixes.
- Do not use the original document
_id
when creating log entries.
- Add
--diff-object
option to the cli.
- Make is possible to pass
diffObject
option to the programmatic interface. This will produce a document diff which contains objects when doing changes on array-like instances (objects with numeric keys).
- Make it possible to pass the log collection to the programmatic interface. Can be a string or
mongojs
collection instance.
- Make it possible to pass a
mongojs
database instance tomongopatch
when used programmatically (the database is not closed).
- Updated dependencies. New version of
mongojs
has breaking interface changes, which also affects the behaviour ofpatch.db
object (an instance of themongojs
db class). - Fix tests on windows. Use the
win-spawn
module for cli tests.
- Added optimistic locking fallback using the
$where
operator. Some documents didn't match them self when used in a query.
- Remove
$where
clause when performing updates indocument
mode. It caused noticable database-wide slowdowns. Properties added to the root of the document, which pass the query, are not detected anymore when doing optimistic locking.
- Fix accumulated diff, by excluding skipped documents in the calculation.
- Added
document
update mode. Uses the whole document as query when performing the update (optimistic locking). This is now the default mode. Issue #3. - Validate provided database and collection. Nonexsting database or collection raise an error. Issue #5.
- Validate command-line arguments. Unknown arguments raise an error. Issue #4.
- Fix command-line argument parsing bug where
--dry-run
and--parallel
didn't work. - Mixin provided query when updating document, to make sure the document still statisfies the criteria. Issue #3.