Closed cecilphillip closed 9 years ago
Hm, yeah. So, here's what's happening -- when you write something like "e.DateCreated.Date.Equals(today)", rethinkdb-net needs to transform that into a server-side query expression. The problem is that the library doesn't currently know how to convert the "Date" property on the DateTime type into a server-side expression, so, it tries the next best thing which is to evaluate it client-side, but then it can't do that because it doesn't know the value of "e.DateCreated" on the client-side.
The short story is that you can probably avoid this error by using .Year, .Month, and .Day fields on the DateTime rather than .Date. All of those properties will work.
How we convert the expressions into server-side code for DateTime objects is defined here: https://github.com/mfenniak/rethinkdb-net/blob/master/rethinkdb-net/Expressions/DateTimeExpressionConverters.cs, so you can see what properties and methods are supported.
Thanks again
I'm working on the query I originally posted in #222.
my date expressions don't seem to be valid/
Failed to perform client-side evaluation of expression tree node 'e.DateCreated.Date.Equals(value(RethinkToss.Program+<>c__DisplayClass0).today)'; this is caused by referring to a server-side variable in an expression tree that isn't convertible to ReQL logic"
Could you advise/direct me to what the allowable DateTime expressions are ?