From user-return-19913-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Fri Feb 24 10:04:19 2012 Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EA6309D6B for ; Fri, 24 Feb 2012 10:04:18 +0000 (UTC) Received: (qmail 31924 invoked by uid 500); 24 Feb 2012 10:04:17 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 31884 invoked by uid 500); 24 Feb 2012 10:04:17 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 31873 invoked by uid 99); 24 Feb 2012 10:04:17 -0000 Received: from minotaur.apache.org (HELO minotaur.apache.org) (140.211.11.9) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Feb 2012 10:04:17 +0000 Received: from localhost (HELO mail-iy0-f180.google.com) (127.0.0.1) (smtp-auth username rnewson, mechanism plain) by minotaur.apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Feb 2012 10:04:17 +0000 Received: by iabz7 with SMTP id z7so3839000iab.11 for ; Fri, 24 Feb 2012 02:04:16 -0800 (PST) Received-SPF: pass (google.com: domain of rnewson@apache.org designates 10.42.46.76 as permitted sender) client-ip=10.42.46.76; Authentication-Results: mr.google.com; spf=pass (google.com: domain of rnewson@apache.org designates 10.42.46.76 as permitted sender) smtp.mail=rnewson@apache.org Received: from mr.google.com ([10.42.46.76]) by 10.42.46.76 with SMTP id j12mr1506805icf.22.1330077856528 (num_hops = 1); Fri, 24 Feb 2012 02:04:16 -0800 (PST) MIME-Version: 1.0 Received: by 10.42.46.76 with SMTP id j12mr1230925icf.22.1330077856517; Fri, 24 Feb 2012 02:04:16 -0800 (PST) Received: by 10.42.6.72 with HTTP; Fri, 24 Feb 2012 02:04:16 -0800 (PST) In-Reply-To: <799D661808754EB0B38AD2CD11A9AD26@martynus.net> References: <799D661808754EB0B38AD2CD11A9AD26@martynus.net> Date: Fri, 24 Feb 2012 10:04:16 +0000 Message-ID: Subject: Re: why does `/_changes?since=0` return deleted documents? From: Robert Newson To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 the changes feed is used for replication. It is essential that a document deleted on A is deleted on B when you replicate A to B. CouchDB only replicates the latest version of any document, which is why you will see a document only once, not five times. The changes feed does not include every change made to the database, it is a list, in update order, of the current revisions of every document. B. On 24 February 2012 09:47, Gregor Martynus wrote: > When I understand it right, `/_changes` does not return all changes, only the ones relevant. So for example when document `my_doc` has been changed 5 times, `/_changes?since=0` will return only one result for `"id": "my_doc"`. > > My question is: why does it return deleted docs? If I ask for everything that changed since the beginning, I don't need to know that a document existed that has been deleted meanwhile, do I?