# NDDB change log

## 3.0.2
 - Index updates TRUE by default.

## 3.0.1
 - Readme updated.

## 3.0.0
 - Code for file system operations refactored.
 - New method: NDDB.stream() replaces keepUpdated flag.
 - New method: NDDB.journal() streams all database operations.
 - New method: NDDB.importJournal() restores a db, replaying all operations.
 - New methods: NDDB.loadDir(), NDDB.loadDirSync() load all files in a directory.
 - New static method: NDDB.db() creates a new database.
 - New static method: NDDB.convert() NDDB.convertSync() convert from a format to another.
 - New static method: NDDB.load|loadSync|save|saveSync|loadDir|loadDirSync
 - New format: NDJSON.
 - Dropped: keepUpdated flag.

## 2.0.0
 - `#NDDB.setWD` is applied to all views and hashes.
 - New emit events: 'setwd', 'load', 'save'.
 - Improved CSV saving: keepUpdated, updatesOnly, updateDelay, flatten,
 flattenByGroup options.
 - Cache for all CSV files.
 - `#NDDB.tag` default value is last element in db (before nddb_pointer).
 - `#NDDB.stringify` fetches query, so saving in JSON format is applied to current selection (consistent with csv format).
 - Saving option `flag` deprecated, use `flags instead.
 - Experimental: __parentDb property added to Hashes and Views.
 - Experimental: `#NDDB.on` accepts third parameter for hooks that are shared with child databases.

## 1.19.1
 - Path join of working directory.

## 1.19.0
 - Improved autodetect of csv line breaks.

## 1.18.1
 - Updated package.json.

## 1.18.0
 - Default line break is set to os.EOL.

## 1.17.0
 - Minor bug fixes.

## 1.16.0
 - Events "insert", "remove", "update" receive the ordinal position of the item in the database as last parameter.
 - Update rules can be passed to insert and update methods.
 - `#NDDB.random(N)` selects N random items and breeds a new DB.
 - CSV saving automatically takes care of objects. The level of nestedness can be controlled with the option `.objectLevel`.

## 1.15.1
 - Fixed bug that was not keeping updated the keys array of the NDDBIndex upon removal of items from index.

## 1.15.0
 - `#.setWD()` and `#.getWD() to set and get current working directory.
 - Event listeners that returns FALSE block the operation they are listening to, and also skip successive event listeners on the same event.

## 1.14.1
  - Default functions for methods index, hash, and view.

## 1.13.0
  - Speeded-up method `#NDDBIndex.getAllKeys()`.

## 1.12.0
  - Fix bug loading csv files: unquoted numbers are parsed as number when loading.

## 1.11.0
  - `#.split()` accepts two parameters: the level of recursion, and whether to use use the position inside the array ar key.
  - `#.clear()` does not require a confirmation parameter any longer.
  - `#.clear()` sets previous indexes, hashes or views to NULL, instead of deleting them.

## 1.10.0
  - Improved saving to CSV, headers option can be a function, and adapter parameters can be strings.

## 1.9.0
  - Loading from CSV correctly handles unescaped separators in quotes.

## 1.8.0
  - Removed prepublish script that was causing errors in some systems.

## 1.7.1
  - JSUS.in_array -> JSUS.inArray

## 1.7.0
  - Nested views and hashes do not copy over hooks (hooks are called only once per insert on main db).

## 1.6.0
  - Fixed overflow bug saving large CSV files.

## 1.5.1
  - Fixed bug execution callback on async load of JSON files.

## 1.5.0
  - Fixed bug for loading CSV files in Windows.

## 1.4.1
  - Rewrote load and loadSync for .json and csv

## 1.2.0
  - Cleanup and optimizations

## 1.1.0
  - Added "use stricts"
  - Fixed leaks of variables db, and df
  - Node 0.12 compatible

## 1.0.1
  - Better check for availability of Object.defineProperty method (IE8, IE9).
  - JSUS needs to be available when NDDB is loaded, and not only at constructor time.

## 1.0.0
  - Depracated `#execute()` method, `#fetch()` does it automatically (simpler API, and faster)
  - Added `.lastSelection` property
  - Fixed bug on updating views and hashes on deleted or modified items
  - Fixed bug on selecting items with properties of different types.
  - Improved documentation.
  - Minor fixes.

## 0.9.8
  - `length` property removed completely because it feature detection failed in old browser
  - Cosmetics changes

## 0.9.7
  - Bug-fix: filter `!=` works correctly.
  - Any malformed query will throw an error.

## 0.9.6
  - Bug-fix: `#stringify()` failed to indent output.
  - Shared options are removed from `this.__options` and kept just in `this.__shared`.

## 0.9.5
  - Operators -> Filters. `#addFilter()` can add a new filter.
  - `LIKE`, and `iLIKE` filters added.
  - The symbol `*` can be used to select on any property of the object.
  - `#select()` accepts an array containing the name of the properties that will be used for the selection.
  - `#shuffle()` by default returns a new object, and does not alter the order of the elements in the database. A parameter can control it.
  - More efficient updating of elements in the index
  - Options `log` and `logCtx` are not cloned, by copied by reference. This avoid trying copying potential cyclical structures.

## 0.9.2
  - `#remove()` -> `#removeAllEntries()`
  - `#NDDBIndex.pop() -> #NDDBIndex.remove()` pop is deprecated now

## 0.9.1
  - On request, views, and hashes are now hybrid. They are NDDB object, but they tries to load all current settings, avoiding to creating infinite loops
  - `#cloneSettings()` accepts a leaveOut parameter
  - Empty hash objects are created by the constructor, if an hash function is specified

## 0.9.0
  - Fixed bug with views and hashs created within constructor of inheriting class
  - `#hash()` and `#view()` always creates objects of type NDDB (previously using the constructor of the inheriting class, if any)
  - Fixed bug in loading from browser storage
  - Better error messages
  - Code for Node.js and browser clearly separated
  - NDDB methods throw errors instead of returning false if input parameters are
    incorrect

## 0.8.10
  - Support for shared objects across all breeded instances of NDDB
  - NDDB.log -> this.log
  - `#initLog()` to execute the log function in the proper context
  - Fixed indexes and views not appearing on empty DBs

## 0.8.6
  - Support for property names containing dots

## 0.8.5
  - `#loadCSV`: load the content of a csv file into the database
  - Minor fixes

## 0.8.4

  - NDDBIndexes: `#getAllKeys()` and `#getAllKeyElements`
  - Integration with updated version of Shelf.js
  - Minor fixes

## 0.8.0

  - New faster and more powerful indexing engine
  - Indexes are now objects with own methods: `#get()`, `#update()`, `#pop()`, `#size()`
  - Support for multiple _views_ on the database
  - `#comparator()` becomes `#getComparator()`, and `#compare()` becomes `#comparator()`
  - Deprecated `c`,`h`,`i`; use human readable `comparator`, `hash`, `index` from now on!
  - `#current()` replaces the old `#get()`
  - `#get()` always returns the element at the specified ordinal position in the database
  - Callback functions of hash and index functions must always be specified
  - Hash functions creates NDDB instances of constructor


## 0.7.2

  - `#selexec()` shorthand  for `select().execute()`
  - Fixed bug on emit('update')
  - `#tag()` returns the tagged element
  - `#clear()` removes all volatile data, not just the entries in the database
  - Minor doc improvements

## 0.7.0

  - More efficient selector engine.
  - Select queries can be chained with and, and or methods
  - Select queries are executed with an execute method
  - Objects are not maskeraded at insertation (no hidden .nddbid property injected)
  - Remove method does not remove the elements in parent database
  - Constructor changed, no parent parameter

## 0.6.0

  - fetch accepts no arguments
  - fetchValues returns an object containing all the values in the grouped by property
  - fetchSubObj
  - fetchArray and fetchKeyArray operate only on the first level, and objects in properties are not further flattened
  - fetchArray, fetchKeyArray, and fetchValues accept either a string or an array of strings as key-selector parameter

## 0.5.8

  - Serialization of functions, null and undefined values
  - Removed eval from select queries
  - Travis-ci continous integration
  - Minor bug fixing

## 0.5.0

  - Support for events: 'remove', 'insert'
  - NDDB.index(): provides fast access to objects
  - NDDB.tag(): accepts also objects

## 0.4.0

  - IE compatibility
  - Bug fixing

## 0.3.6

  - Bug fixing
  - NDDB.save beautifies the output by default
  - Post install scripts build the libraries

## 0.3.0

  - NDDB.skim() and NDDB.keep()
  - Full test coverage
  - Make file in bin directory
  - Custom builds
  - Bug fixing

## 0.2.5

  - NDDB.distinct() + test
  - Support for cyclic objects when saving the database to file
  - NDDB.stddev()
  - Bug fixing
  - More tests

## 0.2

  - Introduced indexing. Indexes are created with NDDB.h() or the alias NDDB.hash()
  - NDDB.set() was already deprecated and it has been removed. NDDB.c() or the alias NDDB.compare() should be used instead.
  - NDDB.init() can sets the configuration of the database
