reqlite icon indicating copy to clipboard operation
reqlite copied to clipboard

reqlite not behaving the same as rethinkdbdash with query

Open nodesocket opened this issue 8 years ago • 6 comments

Seeing reqlite not behaving the same as rethinkdbdash with a query:

rethinkdbdash

r.table('accounts').get('nonsense-here').ne(null).run((error, exists) => {
     console.log(exists); // false
});

reqlite

r.table('accounts').get('nonsense-here').ne(null).run((error, exists) => {
     console.log(exists); // true
});

nodesocket avatar Oct 12 '16 23:10 nodesocket

Does this seem right, or am I doing something wrong?

nodesocket avatar Oct 16 '16 21:10 nodesocket

That's probably a bug

On Sun, Oct 16, 2016, 14:13 Justin Keller [email protected] wrote:

Does this seem right, or am I doing something wrong?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/neumino/reqlite/issues/88#issuecomment-254075376, or mute the thread https://github.com/notifications/unsubscribe-auth/ABZOu9OHyVAjZfcRl8Epp-HJTcncgvtMks5q0pN0gaJpZM4KVT8A .

neumino avatar Oct 16 '16 21:10 neumino

I would really appreciate it if we could work out a fix. I know RethinkDB officially shut down, but this issue is causing my tests to fail. Thanks.

nodesocket avatar Oct 16 '16 22:10 nodesocket

I guess there's no special handling to compare DocNotFound and null.

Also this project has never been officially sponsored by RethinkDB

neumino avatar Oct 18 '16 14:10 neumino

@neumino I understand that reqlite and thinky are not officially supported. I really appreciate the amazing work you've put into both projects. I am building my new project using Thinky in fact.

This bug, and https://github.com/neumino/thinky/issues/581 are currently blocking me though. Is there anyway you could take a look at these? I know you're in the bay area, and if it's ok, I am willing to come up and meet you for lunch or something (on me) and we can fix them.

nodesocket avatar Oct 18 '16 21:10 nodesocket

Just ran into the same. As a work-around, you can try:

r.table('accounts').get('nonsense-here').default(null).ne(null).run((error, exists) => {
  console.log(exists); // false
});

If you are ok with the result being truthy/falsy and not necessarily a boolean, you can skip the ne(null).

simonratner avatar Oct 23 '16 22:10 simonratner