2014-06-16 12:11 GMT+02:00 Σπύρος Σβορώνος <[email protected]>:
> Hi everyone,
> I am quite new and i have a relatively simple question for which i do not
> seem to find the answer. When i try to view a field that has a name which is
> a number (e.g. A field named "123"), if i write something like:
>
> function(doc)
> {
> If (doc.123)
> { list of args}
> }
>
> I get an error saying that the expression does not eval to a function. Does
> anybody know how can i view a field that has this structure?
The problem you encounter here has to do with javascript.
Javascript does not allow you to do doc.123.
It will allow you to access the "123" of doc by using the alternate syntax:
doc[123];
Try it with :
function (doc) {
if (doc[123]) {
// do stuff
}
}
It might be a good idea to read more about javascript.
It's a strong but sometimes strange language :-)
With regards,
Pieter van der Eems
Interactive Blueprints