5.4. GET /db/_changes

5.4.1. Filtering
MethodGET /db/_changes
Request None
Response JSON of the changes to the database
Admin Privileges Requiredno
Query ArgumentsArgumentdoc_ids
 Description Specify the list of documents IDs to be filtered
 Optionalyes
 Typejson
 Defaultnone
   
 Argumentfeed
 Description Type of feed
 Optionalyes
 Typestring
 Defaultnormal
 Supported Values 
 continuousContinuous (non-polling) mode
 longpollLong polling mode
 normalNormal mode
   
 Argumentfilter
 Description Filter function from a design document to get updates
 Optionalyes
 Typestring
 Defaultnone
 Supported Values 
   
 Argumentheartbeat
 Description Period after which an empty line is sent during longpoll or continuous
 Optionalyes
 Typenumeric
 Default60000
 Quantitymilliseconds
   
 Argumentinclude_docs
 Description Include the document with the result
 Optionalyes
 Typeboolean
 Defaultfalse
   
 Argumentlimit
 Description Maximum number of rows rows to return
 Optionalyes
 Typenumeric
 Defaultnone
   
 Argumentsince
 Description Start the results from changes immediately after the specified sequence number
 Optionalyes
 Typenumeric
 Default0
   
 Argumenttimeout
 Description Maximum period to wait before the response is sent
 Optionalyes
 Typenumeric
 Default60000
 Quantitymilliseconds

Obtains a list of the changes made to the database. This can be used to monitor for update and modifications to the database for post processing or synchronization. There are three different types of supported changes feeds, poll, longpoll, and continuous. All requests are poll requests by default. You can select any feed type explicitly using the feed query argument.

The return structure for normal and longpoll modes is a JSON array of changes objects, and the last update sequence number. The structure is described in the following table.

Table 5.3.  Changes information for a database

FieldDescription
last_seq Last change sequence number
results [array] Changes made to a database
        changes [array] List of changes, field-by-field, for this document
        id Document ID
        seq Update sequence number

The return format for continuous mode the server sends a CRLF (carriage-return, linefeed) delimited line for each change. Each line contains the JSON object.

You can also request the full contents of each document change (instead of just the change notification) by using the include_docs parameter.