docs: function (v) {
      if (typeof v === "number")
        return 1;
      if (typeof v === "string")
        return 2;
      if (typeof v === "boolean")
        return 8;
      if (isArray(v))
        return 4;
      if (v === null)
        return 10;
      if (_.isRegExp(v))
        // note that typeof(/x/) === "object"
        return 11;
      if (typeof v === "function")
        return 13;
      if (_.isDate(v))
        return 9;
      if (EJSON.isBinary(v))
        return 5;
      if (v instanceof LocalCollection._ObjectID)
        return 7;
      return 3; // object
  
      // XXX support some/all of these:
      // 14, symbol
      // 15, javascript code with scope
      // 16, 18: 32-bit/64-bit integer
      // 17, timestamp
      // 255, minkey
      // 127, maxkey
    }