limit

limit specifies the maximum number of elements that will be returned.

limit is specified as a numeric integer value.

Limit Examples

The following query returns at most ten entities of class Person.

[{
    "FindEntity": {
        "with_class": "Person",
        "limit": 10,
        "results": {
            "list": ["id"]
        }
    }
}]

Successful response:

[{
    "FindEntity": {
        "entities": [{
            "_class": "Person",
            "id": 0
        }, {
            "_class": "Person",
            "id": 1
        }, {
            "_class": "Person",
            "id": 2
        }, {
            "_class": "Person",
            "id": 3
        }, {
            "_class": "Person",
            "id": 4
        }, {
            "_class": "Person",
            "id": 5
        }, {
            "_class": "Person",
            "id": 6
        }, {
            "_class": "Person",
            "id": 7
        }, {
            "_class": "Person",
            "id": 8
        }, {
            "_class": "Person",
            "id": 9
        }],
        "returned": 10,
        "status": 0
    }
}]

The following query sorts images by year_captured and returns the first three from 1870 onward. The response assumes one image per year:

[{
    "FindImage": {
        "constraints": ["$year_captured", ">=", 1870],
        "sort": "year_captured",
        "limit": 3,
        "results": {
            "list": ["year_captured"]
        },
        "blobs": true
    }
}]

Successful response:

[{
    "FindImage": {
        "returned": 3,
        "status": 0,
        "blobs_start": 0,
        "entities": [{
            "_class": "Images",
            "_blob_index": 0,
            "year_captured": 1870
        }, {
            "_class": "Images",
            "_blob_index": 1,
            "year_captured": 1871
        }, {
            "_class": "Images",
            "_blob_index": 2,
            "year_captured": 1872
        }]
    }
}]