Il 24/05/13 14:34, Manuele Pesenti ha scritto:
> Hi!
>
> just tryed the DAL with a couchdb connection but a simple query like
> that gave me this error:
>
> ServerError: (500, (u'compilation_error', u'Expression does not eval to
> a function. ((new String("(function(simple){if((simple.age >
> 0L))emit(simple._id,[simple._id,simple.name,simple.age,simple.pressure]);})")))'))
>
> I found that the value (0L in this case) have to be between ""
I beg your pardon the real problem was the L after the value... in this
case I need a comparison between integers.
I noticed that even If I have defined my age Field as integer the vaues
are stored as string so the right query tested with Futon is:
(function(simple){if((parseInt(simple.age) <
300))emit(simple._id,[simple._id,simple.name,simple.age,simple.pressure]);})
> the correct version of the query is: (function(simple){if((simple.age >
> "0L"))emit(simple._id,[simple._id,simple.name,simple.age,simple.pressure]);})
> that tested under the Futon web interface it gave me the expected result...
>
> is it a known bug?
>
> I'm using version 2.4.6-stable+timestamp.2013.05.03.22.24.45
>
> Cheers
>
> Manuele
>
--
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.