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
Am 16.06.2014 um 12:29 schrieb Pieter van der Eems
p.van.der.e...@interactiveblueprints.nl:
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:
+1
I'll only add it
Thanks for yous replies guys! I ll have a more in depth look into javascript!
Cheers
On Jun 16, 2014, at 3:29 AM, Pieter van der Eems
p.van.der.e...@interactiveblueprints.nl wrote:
doc[123];
That should be
doc[123];
since the key is a string, not a number.
—Jens
Actually a number should work since it will be coerced into a string. At
least this happens in Chrome.
I know using auto-coercion is uncool but I thought I'd just throw that out
there.
On Mon, Jun 16, 2014 at 12:40 PM, Jens Alfke j...@couchbase.com wrote:
On Jun 16, 2014, at 3:29 AM, Pieter