RethinkDb.Driver icon indicating copy to clipboard operation
RethinkDb.Driver copied to clipboard

Wrong OptArg serialisation after OrderBy

Open oliverjanik opened this issue 3 years ago • 0 comments

Version Information

| .NET Full Framework? | 4.8 | | RethinkDB Server | 2.3.6 |

Hi I have a very simple indexed orderby:

R.Db("db").Table("table").OrderBy().OptArg(R.Desc("lastName")).Limit(100)

This gives me:

RethinkDb.Driver.ReqlServerCompileError
Expected a TermType as a NUMBER but found STRING.

It produces this raw string:

$reql_reqlraw$[71,[[41,[[15,[[14,["db"]],"table"]]],{"index":["DESC",["lastName"]]}],100]]

Notice the "DESC" in the raw string? Should be 74. I believe OptArgs have a serialisation bug where they use globally defined JsonConvert.Settings accidentally and therefore the enum is serialised as string.

Any workarounds?

oliverjanik avatar Oct 21 '22 02:10 oliverjanik