neumino / reqlite

Reqlite - RethinkDB in JavaScript
MIT License
338 stars 25 forks source link

reqlite not behaving the same as rethinkdbdash with query #88

Open nodesocket opened 8 years ago

nodesocket commented 8 years ago

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 commented 8 years ago

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

neumino commented 8 years ago

That's probably a bug

On Sun, Oct 16, 2016, 14:13 Justin Keller notifications@github.com 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 .

nodesocket commented 8 years ago

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.

neumino commented 8 years ago

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

Also this project has never been officially sponsored by RethinkDB

nodesocket commented 8 years ago

@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.

simonratner commented 8 years ago

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).