In CouchDB's answer _changes, why do arrays of elements "change"?

CouchDB's response to the _changes request is returned in this format: {"Next": 12, "identifier": "Foo", "changes": [{"red": "1-23202479633c2b380f79507a776743d5"}]}

My question is: why is the "changes" element an array? In which scenario will more than one item be returned in a change item? I have never seen an example on the Internet with more than one subject, and from my own experience I have seen only one element.

I am writing code that interacts with changes, and I would like to understand what to do if there really were more than one element.

Thanks Mike

+5
source share
1 answer

- , . , CouchDB , , , , . - , . :

  • A B:

    { "" : [ { "" : 1, "" : "" , "" : [{ "" : "1-967a00dff5e02add41819138abb3284d" }]} ], "Last_seq" : 1}

  • B:

    { "" : [ { "" : 2, "" : "" , "" : [{ "" : "2-7051cbe5c8faecd085a3fa619e6e6337" }]} ], "Last_seq" : 2}

  • ( - ) A:

    { "" : [ { "" : 2, "" : "" , "" : [{ "" : "2-13839535feb250d3d8290998b8af17c3" }]} ], "Last_seq" : 2}

  • B. style=all_docs, :

    { "" : [ { "" : 3, "" : "" , "" : [{ "": "2-7051cbe5c8faecd085a3fa619e6e6337" }, { "": "2-13839535feb250d3d8290998b8af17c3" }]} ], "Last_seq" : 3}

    wining ( seq ), ( , )

  • , :

    { "" : [ { "" : 4, "" : "" , "" : [{ "": "3-2502757951d6d7f61ccf48fa54b7e13c" }, { "": "2-13839535feb250d3d8290998b8af17c3" }]} ], "Last_seq" : 4}

  • , ? ? :

    { "" : [ { "" : 5, "" : "" , "" : [{ "": "2-13839535feb250d3d8290998b8af17c3" } { "": "4-149c48caacb32c535ee201b6f02b027b" }]} ], "Last_seq" : 5}

    , .

  • B A :

    { "" : [ { "" : 3, "" : "" , "" : [{ "": "3-2adcbbf57013d8634c2362630697aab6" }, { "": "4-149c48caacb32c535ee201b6f02b027b" }]} ], "Last_seq" : 3}

    ? "" : , , - . CouchDB , . , , , CouchDB . .

+8

All Articles