First of all, i want to let you know that i am a novice with node and couchDB and i have this project where i need to add some functionality to the existing application.
So, i have javascript/node/express web application and i want to get a specific document from a remote couchDB, using cradle, and then get a list of its fields and their values. Later on i would need to display those fields/values in some html. I don't know which fields the document has because they are dynamically added/removed by a third party. I was able to get the document i wanted, but i don't know how to iterate through its fields. What would be the best way to do that?
Here is a simpificated sample of the document:
{
"_id": "1.1.5",
"_rev": "5-56ebac233e7f56a14a4534c6902727f7",
"1.1.5.39": {
"Project": {
"Project1": {
"files": "...",
"status": "NEW",
"id": 2
},
"Project2": {
"files": "...",
"status": "ASSIGNED",
"id": 3
}
}
}
"1.1.5.23": {
"Project": {
"Project3": {
"files": "...",
"status": "NEW",
"id": 4
},
"Project4": {
"files": "...",
"status": "NEW",
"id": 5
}
}
}
}
I would need to get the fields '1.1.5.39' and '1.1.5.23', and also the 'status' values. These fields represent some versions of a software. The problem is also fields' format: numbers and dots, so i can't just use 'Object.attribute' notation...