adapt the script according to the new data model; problem: deletes are not anymore correctly propagated as _changes feed returns the 'id' of a deleted document, but the real id is stored as '@id' field