I am testing and learning CouchDB for a project. We want to load a series of JSON files into the DB. The problem I am having is the format of the JSON, as it has keys of "@". For example:
{
"_id":"somestringhere",
"@": [
{
"identifier":"somevalue",
"somekey":"somevalue"
},
{
"somekey":"somevalue",
"somekey":"somevalue"
}
]
}
So I go to write my Map function to emit the value of the "@"
like so:
function(doc) {
emit(null, doc.@);
}
This does not work and throws an error, as its not a valid identifier. What gives? I don't think it's a problem with JSON. More of a javascript error.