GithubHelp home page GithubHelp logo

Comments (6)

bchavez avatar bchavez commented on May 23, 2024

Hey @oliverjanik , I think you need to use ReferenceEquals when comparing null with the AST ReqlExpr.

Could you provide more context with how you're using and why you're checking null?

Thanks,
Brian

from rethinkdb.driver.

oliverjanik avatar oliverjanik commented on May 23, 2024

Yeah that's what I ended up doing, but it confused the hell out of me for a while. Is it intended to be like that?

from rethinkdb.driver.

bchavez avatar bchavez commented on May 23, 2024

@oliverjanik Yea, the operator overload for == is intended. This allows us to write queries like:

.Filter(g => g[nameof(Game.points)].Eq(9))
.Filter(g => g[nameof(Game.points)] == 9) //op overload

Fancy! 👍

Wiki docs for this are here: https://github.com/bchavez/RethinkDb.Driver/wiki/Extra-C%23-Driver-Features#implicit-conversion-operator-overload

from rethinkdb.driver.

oliverjanik avatar oliverjanik commented on May 23, 2024

g[nameof(Game.points)] is never null in these situations, would a null check break anything?

from rethinkdb.driver.

bchavez avatar bchavez commented on May 23, 2024

Hey Oliver,

g[nameof(Game.points)] isn't null per se but I think the field in the JSON document could be null. The server would have the necessary information.

Consider what happens with:

(g => g[nameof(Game.points)] == 9)

This check doesn't happen on the client, it happens on the server. == 9 gets converted into ReQL: .Eq(9). Same would apply for null: == null -> .Eq(null).

🍷 🌴 _"Get drunk on the good life, I'll take you to paradise..."_

from rethinkdb.driver.

oliverjanik avatar oliverjanik commented on May 23, 2024

Alright then, I'm closing this issue.

On a sidenote: It feels like Rethink guys reinvented Expression trees in their Java driver.

from rethinkdb.driver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.