Skip to main content

A data type is the storage type for a field, and determines how the field data is validated and indexed for search.

Contensis supports the following basic data types:

TypeDescriptionApplicable Validations
stringUsed for text entries such as titles, content or markup.required
maxChars
minChars
regex
allowedValues
integerA whole number.required
min
max
decimalA number with a fractional part.required
min
max
decimalPlaces
booleanA value of true or false.required
dateTimeA point in time.required
min
max
pastDateTime
objectAny arbitrary structure as JSON or a string.required
stringArrayAn array of strings.required
maxChars
minChars
regex
allowedValues
maxCount
minCount
integerArrayAn array of integers.required
maxCount
minCount
decimalArrayAn array of decimals.required
min
max
decimalPlaces
maxCount
minCount
dateTimeArrayAn array of dateTimes.required
min
max
pastDateTime
maxCount
minCount
objectArrayAn array of objects.required
maxCount
minCount

Example

json
{
    "string": "This is a simple string",
    "integer": 24,
    "decimal": 1.34,
    "boolean": true,
    "dateTime": "2016-10-12T09:29:18.5144641+01:00",
    "object": {
        "id": "12345",
        "name": "item1"
    },
    "stringArray": [
        "Item 1",
        "Item 2",
        "Item 3"
    ],
    "integerArray": [
        1,2,3
    ],
    "decimalArray": [
        1.2, 3.4, 5.6
    ],
    "dateTimeArray": [
        "2017-03-07T14:37:27.0998174+00:00",
        "2017-03-07T14:39:16.3337294+00:00",
        "2017-03-07T14:39:19.3495296+00:00"
    ],
    "objectArray": [
        {
            "id": "12345",
            "name": "item1"
        },
        {
            "id": "67890",
            "name": "item2"
        }
    ]
}

Still need help?

If you still need help after reading this article, don't hesitate to reach out to the Contensis community on Slack or raise a support ticket to get help from our team.
New support request