bchavez / RethinkDb.Driver

:headphones: A NoSQL C#/.NET RethinkDB database driver with 100% ReQL API coverage.
http://rethinkdb.com/api/java
Other
383 stars 134 forks source link

Wrong OptArg serialisation after OrderBy #163

Open oliverjanik opened 1 year ago

oliverjanik commented 1 year ago

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?