couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Octavian Damiean <mainer...@gmail.com>
Subject Re: any good way of filtering out your own _changes?
Date Thu, 04 Oct 2012 08:03:28 GMT
If all you want is truly unique document IDs then you can generate a SHA-1
hash over the content, username, userid and timestamp for example.

However if you need a globally sequential ID then you'll need a centralized
point which handles it.

On Thu, Oct 4, 2012 at 9:10 AM, Nick North <north.n@gmail.com> wrote:

> I would go for your suggestion of including a source field in the
> documents. If multiple instances of the app are a potential problem, then
> it can generate a UUID on startup and use that as the source.
>
> Alternatively you could generate your own doc ids and include the source
> string in the doc id. That is probably harder as you have to make certain
> your doc ids are unique.
>
> Nick
>
> On 4 Oct 2012, at 07:35, svilen <az@svilendobrev.com> 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
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message