docs: function NDDB(options, db) {
          var that;
          that = this;
          options = options || {};
  
          // ## Public properties.
  
          // ### nddbid
          // A global index of all objects.
          this.nddbid = new NDDBIndex('nddbid', this);
  
          // ### db
          // The default database.
          this.db = [];
  
          // ### lastSelection
          // The subset of items that were selected during the last operation
          // Notice: some of the items might not exist any more in the database.
          // @see NDDB.fetch
          this.lastSelection = [];
  
          // ### nddbid
          // A global index of all hashed objects
          // @see NDDBHashtray
          this.hashtray = new NDDBHashtray();
  
          // ###tags
          // The tags list.
          this.tags = {};
  
          // ### hooks
          // The list of hooks and associated callbacks
          this.hooks = {
              insert: [],
              remove: [],
              update: []
          };
  
          // ### nddb_pointer
          // Pointer for iterating along all the elements
          this.nddb_pointer = 0;
  
          // ### query
          // QueryBuilder obj
          // @see QueryBuilder
          this.query = new QueryBuilder();
  
          // ### filters
          // Available db filters
          this.addDefaultFilters();
  
          // ### __userDefinedFilters
          // Filters that are defined with addFilter
          // The field is needed by cloneSettings
          // @see NDDB.addFilter
          this.__userDefinedFilters = {};
  
          // ### __C
          // List of comparator functions
          this.__C = {};
  
          // ### __H
          // List of hash functions
          this.__H = {};
  
          // ### __I
          // List of index functions
          this.__I = {};
  
          // ### __I
          // List of view functions
          this.__V = {};
  
          // ### __update
          // Auto update options container
          this.__update = {};
  
          // ### __update.pointer
          // If TRUE, nddb_pointer always points to the last insert
          this.__update.pointer = false;
  
          // ### __update.indexes
          // If TRUE, rebuild indexes on every insert and remove
          this.__update.indexes = false;
  
          // ### __update.sort
          // If TRUE, sort db on every insert and remove
          this.__update.sort = false;
  
          // ### __shared
          // Objects shared (not cloned) among breeded NDDB instances
          this.__shared = {};
  
          // ### __formats
          // Currently supported formats for saving/loading items.
          this.__formats = {};
  
          // ### __defaultFormat
          // Default format for saving and loading items.
          this.__defaultFormat = null;
  
          // ### __wd
          // Default working directory for saving and loading files.
          this.__wd = null;
  
          // ### log
          // Std out for log messages
          //
          // It can be overriden in options by another function (`options.log`).
          // `options.logCtx` specif the context of execution.
          // @see NDDB.initLog
          this.log = console.log;
  
          // ### globalCompare
          // Dummy compare function used to sort elements in the database
          //
          // It can be overriden with a compare function returning:
          //
          //  - 0 if the objects are the same
          //  - a positive number if o2 precedes o1
          //  - a negative number if o1 precedes o2
          //
          this.globalCompare = function(o1, o2) {
              return -1;
          };
  
          // Adding the "compareInAllFields" function.
          //
          // @see NDDB.comparator
          this.comparator('*', function(o1, o2, trigger1, trigger2) {
              var d, c, res;
              for (d in o1) {
                 c = that.getComparator(d);
                 o2[d] = o2['*'];
                 res = c(o1, o2);
                 if (res === trigger1) return res;
                 if ('undefined' !== trigger2 && res === trigger2) return res;
                 // No need to delete o2[d] afer comparison.
              }
  
             // We are not interested in sorting.
             // Figuring out the right return value.
             if (trigger1 === 0) {
                 return trigger2 === 1 ? -1 : 1;
             }
             if (trigger1 === 1) {
                 return trigger2 === 0 ? -1 : 0;
             }
  
             return trigger2 === 0 ? 1 : 0;
          });
  
          // Add default formats (e.g. CSV, JSON in Node.js).
          // See `/lib/fs.js`.
          if ('function' === typeof this.addDefaultFormats) {
              this.addDefaultFormats();
          }
  
          // Mixing in user options and defaults.
          this.init(options);
  
          // Importing items, if any.
          if (db) this.importDB(db);
      }