The limit stage limits the number of documents passed onto the next stage in the pipeline.
{"$limit": <integer>}
Examples
GET /c_patients?pipeline=[{"$match": {"c_gender": "f"}},{"$project": {"c_name": 1}},{"$limit":2}]
{
"data": [
{
"_id": "59495fc1514ef1010000598d",
"c_name": {
"c_first": "Jane",
"c_last": "Smith"
}
},
{
"_id": "59496035bfd25d0100661faf",
"c_name": {
"c_first": "Holly",
"c_last": "Forrester"
}
}
],
"hasMore": false,
"object": "list"
}