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 1A47CD44E for ; Thu, 4 Oct 2012 08:21:26 +0000 (UTC) Received: (qmail 33117 invoked by uid 500); 4 Oct 2012 08:21:24 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 32925 invoked by uid 500); 4 Oct 2012 08:21:24 -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 32903 invoked by uid 99); 4 Oct 2012 08:21:23 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Oct 2012 08:21:23 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.85.216.180] (HELO mail-qc0-f180.google.com) (209.85.216.180) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Oct 2012 08:21:18 +0000 Received: by mail-qc0-f180.google.com with SMTP id v28so154412qcm.11 for ; Thu, 04 Oct 2012 01:20:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-originating-ip:in-reply-to:references:date :message-id:subject:from:to:content-type:x-gm-message-state; bh=w4EUW8oLSKfo2Mahj9mbdDUEVLNgCs2VDyNFNQSwmVY=; b=MwZwHwhOFXi6v/ZGVO3WmmSEtH4K1yMZGcqSwepojlX76cQGCoXjNHM7vnB3B43u4E 6DXAli7D7yNH1IJ/EUJZunqYgHTGjNEFZgrVFLiJzIjZri50+ARc9AwgcotjqVv50USB a7VTvOUhgKT5tAQ/Q4X6M/F9Kw6mdqbdt/nz68kkSTgGYH2pOKXKQyImtqDTuw6/syYk dQN66/n7bnE8gAfAlnpeo/JkoIG3RYt0qSdFzUDmPt0vjcYq8Ele6E6RwH+3SZTf8hyA Mx1jQ8z2sp1I0SarQyEuPcP1kufxjItE4n4Md5yjC18tdrrleafW1gHEhN++nwYmVe6S OPxA== MIME-Version: 1.0 Received: by 10.224.212.3 with SMTP id gq3mr11113032qab.52.1349338856958; Thu, 04 Oct 2012 01:20:56 -0700 (PDT) Received: by 10.49.35.48 with HTTP; Thu, 4 Oct 2012 01:20:56 -0700 (PDT) X-Originating-IP: [84.112.19.176] In-Reply-To: <20121004093513.47fe9a1d@eee-az> References: <20121003171913.02e33b2b@eee-az> <20121004093513.47fe9a1d@eee-az> Date: Thu, 4 Oct 2012 10:20:56 +0200 Message-ID: Subject: Re: any good way of filtering out your own _changes? From: Dave Cottlehuber To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQkuQr9p+EuWnY1nKUWjvHyn/XChtLon0wnzY/LybNJE2Jr1VBDdrNZOtTL+kGhC6X3Hn8Vz X-Virus-Checked: Checked by ClamAV on apache.org On 4 October 2012 08:35, svilen wrote: > so noone to suggest something? > >> > so i have a local db that replicates bidirectional with several >> > others. an app uses local db, listens to _changes and also puts >> > things sometimes. Any way to avoid it seeing it's own changes? > >> > i guess i can put a manual field e.g. "source" to *each* document or >> > something... but that's not very neat. but may be the only way, >> > hmmm - e.g. how to differ between different copies of same app.. >> > running in parallel. > > svil I keep thinking that the right way to do this is to handle messages in such a way that an incoming update doesn't force a refresh. This would mean keeping a list of posted doc ids and simply removing them from the list of pending "reverse updates" when they did come in. Depending on what UI you are using, something like backbone's models might even take care of that for you. It's a question of volume - do you want to replicate *all* docs (easy, no load for filtered replication), and absorb a little more network bandwidth, or do you want to add an extra field, save the bandwidth, and then use filtered replication which will mean running an additional check on every replicated document for every user for every chat room? The former is IMHO far better. Although using an erlang filter would be wicked fast. Some reading for you around hooking couch to backbone: http://janmonschke.com/projects/backbone-couchdb.html https://github.com/pyronicide/backbone.couchdb.js https://github.com/cloudant-labs/backbone.cloudant A+ Dave