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 8DDB2D5E2 for ; Thu, 21 Feb 2013 11:28:01 +0000 (UTC) Received: (qmail 99072 invoked by uid 500); 21 Feb 2013 11:28:00 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 98942 invoked by uid 500); 21 Feb 2013 11:28:00 -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 98933 invoked by uid 99); 21 Feb 2013 11:28:00 -0000 Received: from minotaur.apache.org (HELO minotaur.apache.org) (140.211.11.9) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Feb 2013 11:28:00 +0000 Received: from localhost (HELO mail-la0-f51.google.com) (127.0.0.1) (smtp-auth username rnewson, mechanism plain) by minotaur.apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Feb 2013 11:27:59 +0000 Received: by mail-la0-f51.google.com with SMTP id fo13so8478446lab.24 for ; Thu, 21 Feb 2013 03:27:57 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.112.49.201 with SMTP id w9mr9462143lbn.2.1361446077814; Thu, 21 Feb 2013 03:27:57 -0800 (PST) Received: by 10.112.25.201 with HTTP; Thu, 21 Feb 2013 03:27:57 -0800 (PST) In-Reply-To: <20130221202501.6eb2e1a8@dede> References: <20130221200843.3bb8db3f@dede> <20130221202501.6eb2e1a8@dede> Date: Thu, 21 Feb 2013 11:27:57 +0000 Message-ID: Subject: Re: email as _id? From: Robert Newson To: "user@couchdb.apache.org" Content-Type: text/plain; charset=ISO-8859-1 It would be safer to always add "email:" at the front and always strip the first six characters, rather than look for the colon. B. On 21 February 2013 11:25, svilen wrote: > yes, i did so. the ':' is invalid for emails, so it's easy to decide > whether to strip/prepend or not > > On Thu, 21 Feb 2013 11:14:27 +0000 > Robert Newson wrote: > >> correct, you can't start a doc id with _. It seems simple enough to >> solve this by prefixing "email:" to your ids. >> >> B. >> >> On 21 February 2013 11:12, Vincenzo Scolaro >> wrote: >> > I had the same need and I did it this way >> > id = md5 (email) >> > >> > What do you think? >> > >> > Vincenzo >> > >> > >> > 2013/2/21 svilen >> > >> >> hi >> >> the docs state that anything can be put in _id, except that it >> >> can't start with "_" underscore. >> >> >> >> still, the _ is valid character for starting email address... >> >> effectively meaning that in general, e-mail addresses cannot be >> >> used as id (the only enforced unique thing).. and has to be stored >> >> as a field. or prepended with something non-underscore. >> >> >> >> correct? >> >> >> >> svil >> >>