incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Bykov <m.by...@gmail.com>
Subject Re: _id = "."
Date Wed, 24 Aug 2011 16:36:35 GMT
2011/8/24 Mikhail A. Pokidko <mikhail.pokidko@gmail.com>:
> On Wed, Aug 24, 2011 at 4:21 PM, Michael Bykov <m.bykov@gmail.com> wrote:
>> Hi,
>>
>> How can I delete a row with "_id" = "." ?
>
> Quite opposite question - how did you create such a doc?))
>
> I got Error: file_exists. The database could not be created, the file
> already exists.


That is my code:

hsh = get_json name
id = [hsh['descr'], hsh['var']] * '.'
doc_url = "#{DB}/#{id}"
rev = JSON.parse( RestClient.get( doc_url ) )['_rev'] rescue nil
hsh['_rev'] = rev if rev
RestClient.put doc_url, hsh.to_json, :content_type => :json, :accept => :json


and I think id variable was in that moment = ".", i.e [nil, nil] * '.'



-- 
лю.

http://diglossa.ru
xmpp://m.bykov@jabber.ru

Mime
View raw message