couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Bonhage <quee...@me.com>
Subject Re: how to delete document with empty _id
Date Tue, 27 Sep 2011 17:27:55 GMT
couchdb -i

DbName = <<"database_name_here">>,
DocId = <<>>,
rr(couchdb),
{ok, Db} = couch_db:open(DbName, [{user_ctx, #user_ctx{roles=[<<"_admin">>]}}]),
case couch_db:open_doc(Db, DocId) of
        {ok, Doc} ->
            couch_db:update_doc(Db, Doc#doc{deleted=true}, []);
        Error ->
            Error
end.


>> On 09/27/2011 10:00 AM, Alexander Shorin wrote:
>>> 
>>> By the way, could hovercraft[1] solve this task? No one have interested?
>>> 
>>> [1] https://github.com/jchris/hovercraft
>>> 
>>> --
>>> 
>>>>> On 09/27/2011 08:50 AM, Mark Hahn wrote:
>>>>> 
>>>>>> There is no document without _id.
>>>>>> Not true.  I've managed to create a doc with a blank id also.  I
don't
>>>>>> remember how the bug worked that caused it, but I had to delete the
db
>>>>>> to
>>>>>> get rid of it.
>>>>>> 
>>>>>> 
>> 
>> 


Mime
View raw message