Hi all,
I'm relatively new to CouchDB and PouchDB and App Development in general.
I have started to implement a project as a learning effect and decided after testing different technologies to use a combination of PouchDB / CouchDB.
For the beginning the replicaton to CouchDB is not essential. But I really like this feature.
So right now I have the following setup:
- PouchDB
- BackbonePouch
- Backbone.js
- Underscore.js (especially used to render the HTML code)
- Cordova / Phonegap to deploy on IOS, later maybe Android
I could setup the database and also access the documents via a map query.
Now I'm struggling to reference to the result of the map/reduce query.
It's easy as long as I reference to the first hierarchy like (e.g.: "_id", "name_attribute").
But as soon as I'd like to reference on nested objects it's starting to get tricky. In my data model I have something like
{
"transactions":
sometransactionid: {
"name":"Some name",
"value": 12.23
},
othertransactionid: {
"name":"Other name",
"value": 12.23
}
}
I use a incremental query to emit each transaction as a key / value pair.
The question is now, how do I reference on this values.
If I understand PouchDB correctly in a "normal" map/reduce query the document is attached to the result and all names of a underscore template directly match to the doc, instead of the key /value pairs.
Do I have here a misunderstanding? How could I solve this problem?
Thanks in advance for your help!
Bernd