Skip to main content

limit

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

limit is specified as a numeric integer value.

Limit Examples

In this example, maximum 10 entity with class Person will be returned.

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

Successful response:

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

In this example, the images are sorted by year_captured and the top 3 starting from 1870 are returned. Assuming there is 1 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": [{
"_blob_index": 0,
"year_captured": 1870
}, {
"_blob_index": 1,
"year_captured": 1871
}, {
"_blob_index": 2,
"year_captured": 1872
}]
}
}]