code: function Persistence(options) {
      this.db = options.db;
      this.inMemoryOnly = this.db.inMemoryOnly;
      this.directoryName = this.db.filename;
      this.keys = options.keys || ["_id"];
  
      //jsreport - we need to have parallel cache with _id index because nedb is removing
      //fist from indexes and then from Persistence. Therefore we would have no way of nowing
      //the document key and would not be able to get correct filename to delete.
      this.dataByIdCache = {};
  
  
      // For NW apps, store data in the same directory where NW stores application data
      if (this.directoryName && options.nodeWebkitAppName) {
          console.log("==================================================================");
          console.log("WARNING: The nodeWebkitAppName option is deprecated");
          console.log("To get the path to the directory where Node Webkit stores the data");
          console.log("for your app, use the internal nw.gui module like this");
          console.log("require('nw.gui').App.dataPath");
          console.log("See https://github.com/rogerwang/node-webkit/issues/500");
          console.log("==================================================================");
          this.directoryName = Persistence.getNWAppFilename(options.getNWAppDirectoryName, this.directoryName);
      }
  
      Persistence.ensureDirectoryExists(this.directoryName);
  }
docs: Create a new Persistence object for database options.db
  @param {Datastore} options.db
  @param {Boolean} options.nodeWebkitAppName Optional, specify the name of your NW app if you want options.filename to be relative to the directory where
  Node Webkit stores application data such as cookies and local storage (the best place to store data in my opinion)