incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maill...@ol-mars.se
Subject Dynamic permanent views
Date Fri, 17 Jul 2009 12:51:42 GMT
I'm trying to write a view that enables me to extract data from my couch
depending on what variables I'm passing to it.

Here is an example of what an entry in the db might look like:


{
"@type": "LocationHelperTest",
"_id": "cad119d5abf74997a1dac4ca8ca6b266",
"_rev": "2526720230",
"name": "Test",
"what": {
"@new": 1,
"@old": null,
"@resource_id": "21716c48bc8211a522f0ac684acb1ea8"
},
"when": {
"@recieved": "2009-07-17T07:08:04.765000"
},
"who": {
"user_id": "user"
},
"why": {
"new_state": "new state",
"old_state": "old state",
"reason": "A random reason"
}
}


As you can see, I have a field, @resource_id, in the "what" dict. This
is the same as the ID for another entry in the db that is called
LocationTest. I'm using Pylons to write my system, and through the URL I
get the ID. With this ID I want to find all LocationHelperTests with the
@resource_id that matches this ID.

How do I do this with views? (Or any other way if there is any). I'm not
interested in temporary views, but wants a permanten view.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message