couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bsquared <bwcod...@gmail.com>
Subject Re: how to delete document with empty _id
Date Wed, 28 Sep 2011 17:50:39 GMT
Christopher Bonhage <queezey@me.com> writes:

> 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.
>
>

It appears that I need to include a user_ctx record the response from
this code was:
* 5: record user_ctx undefined

-- 
Regards,
Brian Winfrey


Mime
View raw message