---
id: "mn_bag_code"
kind: "datatype"
status: "draft"
is_pii: false
name: "Mongolian subdistrict code (bag or khoroo code)"
regexp: "^0(?:11|2[123]|4[1-68]|6[1-57]|8[1-5])\\d{4}$"
categories: ["geo", "government"]
country: ["MN"]
langs: ["common"]
quality: 83
url: "https://registry.apicrafter.io/datatype/mn_bag_code"
---

# Mongolian subdistrict code (bag or khoroo code) (`mn_bag_code`)

> **Draft.** Draft records have not been reviewed yet and may be incomplete or wrong; do not treat them as authoritative for legal or compliance decisions.

Seven-digit code of a Mongolian bag or of a khoroo of Ulaanbaatar in the classification of administrative units of the National Statistics Office, the code of its soum or district (mn_soum_code) and two digits, such as 0211353 in Dornod.

- Personal data (PII): no
- Categories: Geographic identifiers (geo), Government related (government)
- Countries: Mongolia (MN)
- Languages: Common to most languages (common)
- Classification: identifier

## Detection

Regular expression (Python `re`):

```
^0(?:11|2[123]|4[1-68]|6[1-57]|8[1-5])\d{4}$
```

## Examples

- `0211353`
- `0640151`
- `0830175`
- `02113` (invalid example) — A soum code (mn_soum_code)

## Metacrafter rules

1 rules: 1 match the field name, 0 match values.

- `mnbagcodebyname` (field, `mn/mn_geo.yaml`)

## Supported by tools

- [`metacrafter`](https://registry.apicrafter.io/tool/metacrafter.md)

## Translations

- mn: Багийн код
- ru: Код бага Монголии

## Sources

- other: <https://rdrr.io/cran/mongolmaps/man/mn_codes.html>

## Quality

Score 83/100. Missing: authoritative source link, mapping (Wikidata, Schema.org, ...).

JSON: <https://registry.apicrafter.io/api/v1/datatypes/mn_bag_code.json> · Edit: <https://github.com/apicrafter/metacrafter-registry/edit/main/data/datatypes/MN/geo/mn_bag_code.yaml>
