Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 87898 invoked from network); 19 Oct 2010 15:15:51 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 19 Oct 2010 15:15:51 -0000 Received: (qmail 59561 invoked by uid 500); 19 Oct 2010 15:15:50 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 59409 invoked by uid 500); 19 Oct 2010 15:15:49 -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 59401 invoked by uid 99); 19 Oct 2010 15:15:49 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Oct 2010 15:15:49 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of industral@gmail.com designates 209.85.212.52 as permitted sender) Received: from [209.85.212.52] (HELO mail-vw0-f52.google.com) (209.85.212.52) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Oct 2010 15:15:40 +0000 Received: by vws8 with SMTP id 8so1569500vws.11 for ; Tue, 19 Oct 2010 08:15:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type; bh=ok6gKBwamXl6Km+dUOIDPoEcCXuFiRiarl1o03Q3m14=; b=O75V/MKDt9l2y8jDkkFOWqAGivIalA3nfXN+kxfdp4O9KQ+f8ZabK30SKS7o/A/a62 /5l/O5AKhIv4rbY3w0TpHYagvnPy3MBbioWHChoHoXNllgZmGzvo6lZl83d4390oPPuh mmiEti++J8bt0m+b2S9cHYHL8g7oiVPy03inM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; b=DCBJ1Wh1hWstN28mGqclzTO1YOV/KIwbi5Ykvt0a7HVehJDDzXm6yBeylCixIKAP1Z cFv8XEHv+ByrRfohYnRb1dhZVbp3ZmyapY9Jx5cdIaZ6PJMd9/kHX3vpFTV/WMGRjALg OWV887ykJHOMKtpRACetvQpp6/XrAZ1uibvnc= Received: by 10.103.213.11 with SMTP id p11mr3574720muq.98.1287501314597; Tue, 19 Oct 2010 08:15:14 -0700 (PDT) Received: from [192.168.0.20] ([194.44.192.248]) by mx.google.com with ESMTPS id o6sm2350853fal.15.2010.10.19.08.15.13 (version=SSLv3 cipher=RC4-MD5); Tue, 19 Oct 2010 08:15:13 -0700 (PDT) Message-ID: <4CBDB5FF.3010602@gmail.com> Date: Tue, 19 Oct 2010 18:15:11 +0300 From: Alex Ivasyuv User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.12) Gecko/20100915 Lightning/1.0b1 Thunderbird/3.0.8 MIME-Version: 1.0 To: user@couchdb.apache.org Subject: Re: DELETE doc without rev References: <4cbd82b4.5907df0a.34c6.64c0@mx.google.com> <4CBDAE89.1050101@gmail.com> In-Reply-To: Content-Type: multipart/alternative; boundary="------------040708030107010008070807" X-Virus-Checked: Checked by ClamAV on apache.org --------------040708030107010008070807 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit On 10/19/2010 06:12 PM, Robert Newson wrote: > it's _deleted not _delete > Thanks, It works! > B. > > On Tue, Oct 19, 2010 at 10:43 AM, Alex Ivasyuv wrote: > >> On 10/19/2010 04:54 PM, Johannes J�rg Schmidt wrote: >> >>> You could write an update function which sets doc._delete to true. This >>> way >>> you can delete a document sending only one request. >>> >>> >> That's exactly that I looked for, but unfortunately it doesn't work for me: >> >> {"error":"doc_validation","reason":"Bad special document member: _delete"} >> >> CouchDB 1.0.1 >> >> Code: >> >> function(doc, request) { >> >> // if no record found, we create it manually >> if (!doc) { >> doc = { >> _id: request.id >> }; >> } >> >> if (request.query.action === "delete") { >> doc._delete = true; >> } else { >> >> // set all passed params to object >> for (i in request.query) { >> doc[i] = request.query[i]; >> } >> } >> >> // save doc >> return [ >> doc, >> JSON.stringify({ >> result: "success" >> })]; >> } >> >> >>> Greetings Johannes >>> Am 19.10.2010 15:30 schrieb "Matt Goodall": >>> >>> >>> >>>> On 19 October 2010 12:35, Alex Ivasyuv wrote: >>>> >>>> >>>>> Thanks Matt for reply, but question still exist, is there some way to >>>>> >>>>> >>>> delete >>>> >>>> >>>>> doc in ONE request without mentioned revision. In your example I need to >>>>> make a GET request first. >>>>> >>>>> >>>> It's not possible in 1 request. As I said, you must provide the current >>>> _rev. >>>> >>>> - Matt >>>> >>>> >>>> >>>>> Thanks, >>>>> >>>>> Sent from my HTC >>>>> >>>>> ----- Reply message ----- >>>>> From: "Matt Goodall" >>>>> Date: Tue, Oct 19, 2010 2:04 pm >>>>> Subject: DELETE doc without rev >>>>> To: >>>>> >>>>> >>>> >>>> >>>>> On 19 October 2010 11:39, Alex Ivasyuv wrote: >>>>> >>>>> >>>>>> Hi, >>>>>> >>>>>> I would like to... >>>>>> >>>>>> >>>> >>>> >>> >>> >> >> -- >> Best regards, >> Alex Ivasyuv >> Senior WebUI Software Engineer >> ReelRoles, Inc. >> >> >> >> -- Best regards, Alex Ivasyuv Senior WebUI Software Engineer ReelRoles, Inc. --------------040708030107010008070807--