
CouchDB: #get attempts to retrieve a view rather than the resource directly.
Reported by Thai Doan | November 3rd, 2008 @ 01:16 AM
CouchDB allows a service to retrieve a document using REST. However, attempts at retrieving a record directly using get attempts to access a view rather than using a REST url. DataMapper will POST a _temp_view instead of using a GET for the identifier.
class User
include DataMapper::Resource
property :id, String, :key => true, :field => :_id, :nullable => true
property :rev, String, :field => :_rev
property :login, String
end
User.create(:login => "foo@bar.com") # => #<User id="1ccec6b60f93af5420029d0c02d4ffcf" rev="3474471722" login="foo@bar.com">
User.get("1ccec6b60f93af5420029d0c02d4ffcf") # CouchDB: 127.0.0.1 - - 'POST' /scratch/_temp_view 200
# Rather, a nicer access would be 127.0.0.1 - - 'GET' /scratch/1ccec6b60f93af5420029d0c02d4ffcf 200
Comments and changes to this ticket
-
Thai Doan November 3rd, 2008 @ 03:24 AM
- Tag changed from couchdb to couchdb, dm-more
Determined this was fixed in 0.9.7.
-
geemus (Wesley Beary) November 30th, 2008 @ 11:54 AM
- State changed from new to invalid
- Assigned user changed from Sam Smoot to geemus (Wesley Beary)
Thanks for pointing it out Thai, but it should work as described (and as you mentioned) in newer versions. So I'm closing.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »