The Basic Structure
Every MON file is a single “labeled container” called an Object. This is the most fundamental rule. An object starts with a { and ends with a }. Inside this container, you organize your facts into key: value pairs, similar to how JSON and TOML structure their data. See how MON compares.
How to Write a key: value Pair
Section titled “How to Write a key: value Pair”- Key: The label for your fact. For simple, one-word keys, you can write them directly. For keys with spaces or special characters, enclose them in double quotes
"". - Colon (
:): Separates the key from the value. - Value: The actual piece of information.
- Comma (
,): Separates one pair from the next. A comma after the last pair is optional but recommended!
// A MON file must start with { and end with }{ // A simple key-value pair with a string value service_name: "My Awesome App",
// You can add notes with comments like this port: 8080, // A number value
"is-enabled": on, // A boolean value (yes/no)}Types of Values (Primitives)
Section titled “Types of Values (Primitives)”- String: Text, enclosed in double quotes (e.g.,
"Hello, World!"). - Number: Numbers, with or without decimals (e.g.,
100,-42.5). - Boolean: A “yes/no” value. Use
on/truefor yes andoff/falsefor no. - Null: Represents “nothing” or an empty value. Use
null.
Great! You’ve mastered the basic structure. Next, we’ll learn how to manage lists of items.