Skip to content

mongo_id ​

Checks that the value is a BSON ObjectId: 24 hex digits.

Error codes: WRONG_MONGO_ID, FORMAT_ERROR

Live example · edit rules or inputOpen in playground
rules
input
Invaliderrors
{
  "id": "WRONG_MONGO_ID"
}

Hex digits are case-insensitive, and the case of the input is kept in the output.