types
types: (object | object)[] = [{ alias: "minKey", number: -1, order: 1, isType: null },{ alias: "null", number: 10, order: 2, isType: null },{ alias: "int", number: 16, order: 3, isType: _.isInteger },{ alias: "long", number: 18, order: 3, isType: _.isNumber },{ alias: "double", number: 1, order: 3, isType: _.isNumber },{ alias: "number", number: null, order: 3, isType: _.isNumber },{ alias: "string", number: 2, order: 4, isType: _.isString },{ alias: "symbol", number: 14, order: 4, isType: _.isSymbol },{ alias: "object", number: 3, order: 5, isType: _.isPlainObject },{ alias: "array", number: 4, order: 6, isType: _.isArray },{ alias: "binData", number: 5, order: 7, isType: null },{ alias: "objectId", number: 7, order: 8, isTypefnc: null },{ alias: "bool", number: 8, order: 9, isType: _.isBoolean },{ alias: "date", number: 9, order: 10, isTypefnc: _.isDate }, // format{ alias: "timestamp", number: 17, order: 11, isType: _.isDate }, // format{ alias: "regex", number: 11, order: 12, isType: _.isRegExp },{ alias: "maxKey", number: 127, order: 13, isType: null }// undefined 6// dbPointer// javascript// javascriptWithScope// function]
Machine id.
Create a random 3-byte value (i.e. unique for this process). Other drivers use a md5 of the machine id here, but that would mean an asyc call to gethostname, so we don"t bother.