CouchDB API query with ?limit=0 returns one row - bug or feature? -
i use couchdb 1.5.0 , noticed strange thing:
when query api action, example:
curl -x "http://localhost:5984/mydb/_changes?limit=1"
i same result limit=1
, limit=0
, limit=-55
. in cases 1 row start of list.
although, postgresql returns:
- zero rows when
limit 0
- message
error: limit must not negative
whenlimit -55
my question concerned api design. know opinions.
it's flaw or maybe it's good/acceptable practice?
this how _changes
api designed. if not specify type of feed i.e long-poll, continuous etc default return list of changes in single results array.
if want row row result of changes in database specify type of feed in url so
curl -x "http://localhost:5984/mydb/_changes?feed=continuous"
another point note in _changes api using 0 has same effect using 1 in limit parameter.
Comments
Post a Comment