benchmark/benchmark.js
/**
 * Helper method for instantiating a loki database
 * @param {*} mode 
 */
Helper method for instantiating a loki database
@param {*} mode
Helper method for instantiating a loki database @param { * } mode
function createDatabase(mode) {
  let tdb = new Loki("temp.db");
  let coll;
  switch (mode) {
    case "avl":
      coll = tdb.addCollection('perfcoll', {
        rangedIndexes: {
          "customId": { indexTypeName: "avl", comparatorName: "js" }
        }
      });
      break;
    case "unique":
      coll = tdb.addCollection('perfcoll', {
        unique: ['customId']
      });
      break;
    case "none":
    default:
      coll = tdb.addCollection('perfcoll');
      break;
  }
  return tdb;
}
function createDatabase ( mode ) { let tdb = new Loki ( "temp.db" ) ; let coll ; switch ( mode ) { case "avl" : coll = tdb . addCollection ( 'perfcoll' , { rangedIndexes : { "customId" : { indexTypeName : "avl" , comparatorName : "js" } } } ) ; break ; case "unique" : coll = tdb . addCollection ( 'perfcoll' , { unique : [ 'customId' ] } ) ; break ; case "none" : default : coll = tdb . addCollection ( 'perfcoll' ) ; break ; } return tdb ; }
Helper method for instantiating a loki database
 @param {*} mode
Helper method for instantiating a loki database @param { * } mode