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 79653184A0 for ; Sun, 21 Feb 2016 14:27:44 +0000 (UTC) Received: (qmail 58684 invoked by uid 500); 21 Feb 2016 14:27:43 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 58606 invoked by uid 500); 21 Feb 2016 14:27:43 -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 58588 invoked by uid 99); 21 Feb 2016 14:27:43 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 21 Feb 2016 14:27:43 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id B7C4B180179 for ; Sun, 21 Feb 2016 14:27:42 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.43 X-Spam-Level: * X-Spam-Status: No, score=1.43 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, KAM_LOTSOFHASH=0.25, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, WEIRD_PORT=0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=googlemail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id oIUmp0BgYzsd for ; Sun, 21 Feb 2016 14:27:40 +0000 (UTC) Received: from mail-vk0-f51.google.com (mail-vk0-f51.google.com [209.85.213.51]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id B69815F60D for ; Sun, 21 Feb 2016 14:27:39 +0000 (UTC) Received: by mail-vk0-f51.google.com with SMTP id c3so110041012vkb.3 for ; Sun, 21 Feb 2016 06:27:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=xCDY4RIWizwla7ZZoa7NH/VDWxBfz9+/E1fu5LPS3Do=; b=M4C+H08E1MdGipaIncjgfyzPjmnVpZWHaQYXW41YtcTbdQCpC4AYp7QJmHTTFX44hW sfvdBwxf5FUpbyoWwZ1eyyKiSYHSXAXSqKRwyjn+crpizJvahq2jgHGf4dw2h9cKHX7M VViLzDoGZI/ASArps3P+OjBxZ3Pv7wZKbInZH2pl8R6NxLC0abiCF30nt/NNSSur4N1m e0wftEQU/FPic9nBwEON4Vpf47KADMZczt/uevQmx8ZtTW/4cx4k1W+s0sqLfjilZXJU 6eTtl3Mtx0iVnTCpKmWO4Y+IFaaqruVUJ7uuag48cv3zLSDI9n3DI7ExiJtbUICzIo0U cJng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=xCDY4RIWizwla7ZZoa7NH/VDWxBfz9+/E1fu5LPS3Do=; b=I7Au6D9MPnioKmSOPZX38MSy7Oa+8AY23PpZjylPymgOst/LGEvldZWpS9obOYx8Nf 1DdP5ijcD7mXh3Uv6aFYjuS9fhCpKU8q0PIMIqbYj2My+X5ckWO+3Io6ur8FWesYQnvh Atf4wTiYgosLXbG3OvBY9Jd2fwS/Ylu4Rm9gQFAO9QVFnUJnvzC922A2iVCxfxPjVKyD dMTeGAHf2uaZfGaflavoVVcl53m7W09wCdvpRpkVq+eifM5fMM6XH9A3N8qRZ4yYFG3L gt9dXhXXMw7b2Ab0XvXA2bPeBBIgSx0hnTTRxrd+EaPbiYa3gcyHaIk2bKQoImVO3WJR 9kxA== X-Gm-Message-State: AG10YOROa99nPiHU6ErJvhisP4oO8CtGKu6AFn8bNdCrMiJhaXEOtBA3I0H6AgBCtsRUPeo6nNgmTz/IkF9Vxw== MIME-Version: 1.0 X-Received: by 10.31.188.142 with SMTP id m136mr19084966vkf.89.1456064858818; Sun, 21 Feb 2016 06:27:38 -0800 (PST) Received: by 10.31.159.145 with HTTP; Sun, 21 Feb 2016 06:27:38 -0800 (PST) In-Reply-To: <20160218142949.GA8741@pax.zz.de> References: <20160218142949.GA8741@pax.zz.de> Date: Sun, 21 Feb 2016 15:27:38 +0100 Message-ID: Subject: Re: changes feed / include delete doc? From: Sebastian Rothbucher To: "user@couchdb.apache.org" Content-Type: multipart/alternative; boundary=001a1143026eae0ece052c48845b --001a1143026eae0ece052c48845b Content-Type: text/plain; charset=UTF-8 Hi Flo, if I'm not completely mistaken, the changes feed does contain the last revision of a modified document or a deletion stub. See the following example: $ curl -X GET ' http://localhost:5984/test/_changes?feed=continuous&heartbeat=3000' # (some changes) # fire foff $ curl -X PUT 'http://localhost:5984/test/bla' -d '{}' {"ok":true,"id":"bla","rev":"1-967a00dff5e02add41819138abb3284d"} # produces changes feed {"seq":4,"id":"bla","changes":[{"rev":"1-967a00dff5e02add41819138abb3284d"}]} # fire off $ curl -X DELETE ' http://localhost:5984/test/bla?rev=1-967a00dff5e02add41819138abb3284d' {"ok":true,"id":"bla","rev":"2-eec205a9d413992850a6e32678485900"} # produces changes feed {"seq":5,"id":"bla","changes":[{"rev":"2-eec205a9d413992850a6e32678485900"}],"deleted":true} 2-eec205a9d413992850a6e32678485900 is in fact the deletion stub's revision ID hope if helps - otherwise pls. let us know Best Sebastian On Thu, Feb 18, 2016 at 3:29 PM, Florian Lohoff wrote: > > Hi, > > i am trying to build a changes listener and for all docs which got > modified or deleted i'd like to get the last version for comparison. > > I am right now using a construct like this: > > > /couchdb/fidb/_changes?feed=continuous&since=X&include_docs=true&heartbeat=3000 > > Get the deleted or changed entrys - Fetch this: > > couchdb/fidb/?revs=true&open_revs=all > > And then fetch the deleted/changed documents revision. > > Is there an easier way i simply didnt recognize? include_last_rev=true ? > > Flo > -- > Florian Lohoff f@zz.de > We need to self-defend - GnuPG/PGP enable your email today! > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.10 (GNU/Linux) > > iQIVAwUBVsXVXZDdQSDLCfIvAQoM4g//Zb3x2RYWzP2xmZS/Bn8DtnKzPYom2IhN > lqi/99/WYhtTDsGQroPF06z7oLFG5+/QmgswOSrAYq+4wMGLzdVwFINCoYDhionQ > EqcKbfuu1Rd0zGPXUaGdHNfNvpRd6lHjRIvrEmsBz/2+toMMO/59p01R2GDdecsc > 5kFlhxrBjCR0j9b+f6gQqKVoY5iq6Rc7947ukx0Ja4D7Orlp/MP95wyKI+o9IS5w > rozMDW8Dy46DQbwMwO+tz4RKPMVpug7DOvPH7p+RS1nm7TrnZV0Db5ZeM7mynIN/ > T7mqa+Anc+L2efEhZAVLv2dGDXikndS0SBKHsxYimFcv6U1eJ7mz5aMhOnsmnelu > ed/MUsuofmo056JksW5pNjPukCTFzcSwEC8BL4L315BhW6BY9r4CT+BoT32LB3UI > Q2TNiAhG+xl5LUI9ScCtdPflEidpWflk41Erbk0gdwaLw+BevMinsYGJAhJtN7ji > 8An4gPPUCWLSjFAB7e8eFPHTIQhvySTkaqnSbsdfEdzc9oEEo87c4shLBZqHMzsE > UmPF+O/1d7Ynx5jCjob3+T8PrR7iI9oCwGlrjbM6BL2VnAu46R6iKtGTs00Chg0p > uekXO58gN+wrcUrc3QL66j7B1DK10PS0TELBW9hULfq6oyiDrK7WEZXIPZZW2tbY > jXlnkGTYvDs= > =AlS3 > -----END PGP SIGNATURE----- > > --001a1143026eae0ece052c48845b--