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 A1402D196 for ; Thu, 16 May 2013 23:32:38 +0000 (UTC) Received: (qmail 36176 invoked by uid 500); 16 May 2013 23:32:37 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 36113 invoked by uid 500); 16 May 2013 23:32:37 -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 36103 invoked by uid 99); 16 May 2013 23:32:37 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 May 2013 23:32:37 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of randall.leeds@gmail.com designates 209.85.219.45 as permitted sender) Received: from [209.85.219.45] (HELO mail-oa0-f45.google.com) (209.85.219.45) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 May 2013 23:32:31 +0000 Received: by mail-oa0-f45.google.com with SMTP id j6so4507899oag.18 for ; Thu, 16 May 2013 16:32:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=EyUqrVUv+TDlK3lDWCrHPSKr7vh0IkMSSKt/F6tmfQ8=; b=iahNZ3/DqyLFmTcPs3EaSUIhgfQnr/UtVxpc4Cq35q3oRm/cZiAuT+74RWzDAviqx2 4rCTqb/B3w419s1hO/Y651gfu2CanUExjuGbqEssvWxTpYdTfYbzqBiH6n8FVkWtMisz 8nAjUAz+GPoq+dDtyecfL0qHcm1TtJ1e0AyMO0DqMBN8RQjCBJlymSA+J1YP556uAJB9 tRlantgWj9g22gWdyybIjWkmhHDG6DK3FAIjcfHX+UMuYBT6Su9P/hdC4/jmNRFtRore 1oz9j9FB7CY27XgWGN0Sa50/QQsXu29qHrcithQZJP/5eTQu3H2o4iCc+MJD0MT5Sl9G DLNw== MIME-Version: 1.0 X-Received: by 10.182.153.5 with SMTP id vc5mr20811985obb.32.1368747130886; Thu, 16 May 2013 16:32:10 -0700 (PDT) Received: by 10.76.29.50 with HTTP; Thu, 16 May 2013 16:32:10 -0700 (PDT) Received: by 10.76.29.50 with HTTP; Thu, 16 May 2013 16:32:10 -0700 (PDT) In-Reply-To: References: <20130516144732.0dda4bbf@svilendobrev.com> Date: Thu, 16 May 2013 16:32:10 -0700 Message-ID: Subject: Re: tracking changes - how to check what was deleted? From: Randall Leeds To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=089e013a0ada86262d04dcde4686 X-Virus-Checked: Checked by ClamAV on apache.org --089e013a0ada86262d04dcde4686 Content-Type: text/plain; charset=UTF-8 Actually, it's even easier than this. It is acceptable to put a body in the DELETE. You can store whatever fields you want accessible in your deletion stubs. On May 16, 2013 9:00 AM, "Dave Cottlehuber" wrote: > On 16 May 2013 13:47, svilen wrote: > > g'day > > so i have multiple (3) kinds of documents (say with fields .type=..) in > > same database. And i listen to changes feed, and according to type, > > show the different kinds of docs in 3 different windows. > > > > if some doc was deleted, how can i guess what .type it had ? > > changes return only _id and _rev of the new deleted stub.. > > is looking up the doc.id in those 3 caches the only option? > > > > ciao > > svilen > > Hey Svilen, > > Some things: > > Changes only returns the "last known good" change (~handwavey~) if > that makes sense - e.g. if doc a -> a' -> a'' -> a''' are processed in > between you checking changes, you will not receive a', a'' at all. > > Document deletion inside couch is simply taking doc._id,_rev only and > storing a new doc._id, doc._deleted, and _rev + 1. There is nothing > stopping you re-implementing DELETE yourself (e.g. update handler > server side, or client side as you like), and storing doc._id _rev AND > _type as well. > > Alternatively, use a byte of the id to store the type if you can achieve > that. > > That should see you right. > > A+ > Dave > --089e013a0ada86262d04dcde4686--