Couchdb 2.0 / db / _find the total number of lines for pagination

I am sending a request (use python lib requests) with json data:

    json_data = {
     "selector": {
        "year": {"$gt": 2010}
     },
     "fields": ["_id", "_rev", "year", "title"],
     "sort": [{"year": "asc"}],
     "limit": 10,
     "skip": 10
    }

    r = requests.post('http://127.0.0.1:5984/docs/_find',
                           json=json_data)

There is no total_rows in the answer. I need full lines for pagination. How do I understand that?

+4
source share

Source: https://habr.com/ru/post/1662862/


All Articles