code: function iterateKeys() {
        var obj = getKeyObject(db, j);
        if(obj === null) return onKeysComplete();
        encoder.write(obj, function onWrite() {
          j++;
          setImmediate(iterateKeys);
        });
      }
docs: iterate keys in a db