ObjectId constructor

ObjectId()

Creates a new object id.

Implementation

factory ObjectId() {
  int timestamp = DateTime.now().millisecondsSinceEpoch ~/ 1000;
  int counter = _nextCounter();
  return ObjectId._internal(
      timestamp, _generatedMachineId, _generatedProcessId, counter);
}