incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Trevor Green" <Tre...@MAILAGC.COM>
Subject How to view child arrays in couch
Date Thu, 16 Jun 2011 22:01:37 GMT

So what I want to do is store php objects in couch.




Json_encode an object that may be a multi-dimensional array and store it
and the view it. 


The stored data would look something like this. 



                "url": "(a url)",

                "status": [{ "somename":


"var1": "mystate",






So how then do map this?


function(doc) {

                emit([doc.url, doc.status, doc.status.(use the first
nameas a key without explicity defining it (ex. somename) ) ], doc);




Maybe use an if(doc.status.(first value) == "somename") to limit the


How do you create views on lists like this that contain associative
arrays with arbitrary data? And how do you then access the children
(var1, var2). 


Can couch not handle a document like this that is valid json but isn't


Or can it handle it and I have to somehow nest views to map the sub


Thanks for any help.


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