Skip to main content
Browse Documentation

Data types

Created by r.turner, last modified by zengenti on 23 Sep 2020

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:

Type Description Applicable Validations
string Used for text entries such as titles, content or markup. required
maxChars
minChars
regex
allowedValues
integer A whole number. required
min
max
decimal A number with a fractional part. required
min
max
decimalPlaces
boolean A value of true or false. required
dateTime A point in time. required
min
max
pastDateTime
object Any arbitrary structure as JSON or a string. required
stringArray An array of strings. required
maxChars
minChars
regex
allowedValues
maxCount
minCount
integerArray An array of integers. required
maxCount
minCount
decimalArray An array of decimals. required
min
max
decimalPlaces
maxCount
minCount
dateTimeArray An array of dateTimes. required
min
max
pastDateTime
maxCount
minCount
objectArray An array of objects. required
maxCount
minCount
Examples
{
    "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"
        }
    ]
}
Necessary Cookies
These cookies are necessary for this website to function correctly. They are set when you perform certain actions on the site, such as creating an account, logging in, changing your privacy preferences or submitting a form. You can block these cookies in your browser, but this will stop parts of the site from working properly.
Functional Cookies
These cookies allow the website to provide extra functionality and more personalised experiences. They may be set by us or by third party providers whose services we have added to our pages. If you choose not to allow these cookies, these services may not work correctly.
Analytical Cookies
These cookies record anonymous data on how visitors use our website to help us monitor how well our website works. This data includes how many people have looked at specific pages, how long visitors stay on the site, and what devices they use. We use this data to identify changes that we could make to improve your experience and make our website more efficient.
Marketing Cookies
We set some cookies so you are shown more relevant marketing content. These include cookies from third-party advertising networks to show you different adverts on their services if you have previously visited our site. If you choose not to allow these cookies, you may experience less relevant advertising on other sites.