isMongoId function

  1. @experimental
bool isMongoId(
  1. String str
)

Returns true if str is a valid 24-character MongoDB ObjectId (hex).

Implementation

@experimental
bool isMongoId(String str) => isHexadecimal(str) && str.length == 24;