incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Markus Jelsma" <mar...@buyways.nl>
Subject Re: view syntax for retrieving object without a field
Date Mon, 25 Jan 2010 21:42:06 GMT
Hello Brian,


Funny, i first used your approach but for some reason it didn't work, it
must have been me writing a typo or juggling thing about. Thanks for
pointing it out!


Brian Candler said:
> On Mon, Jan 25, 2010 at 11:51:05AM -0500, eric casteleijn wrote:
>> >function (doc)
>> >{
>> >   var fields = new Array("name", "country");
>> >
>> >   for (idx in fields)
>> >   {
>> >     if (typeof eval("doc." + fields[idx]) == "undefined")
>
> I must be missing a Javascript subtlety here. What's wrong with
>
>    if (typeof(doc[fields[idx]]) === 'undefined')
>
> ?




Mime
View raw message