neumino / rethinkdbdash

An advanced Node.js driver for RethinkDB with a connection pool, support for streams etc.
MIT License
848 stars 109 forks source link

Omitting `run()` doesn't seem to change behavior #391

Closed benfletcher closed 5 years ago

benfletcher commented 5 years ago

Probably a silly question, but calls seem to execute the same whether or not followed by run().

In short:

r.table('test')
  .then(data => console.log(data));

produces the same output as:

r.table('test').run()
  .then(data => console.log(data));

I'll be using the idiomatic/correct syntax with run(), but would like to understand the underlying mechanics a bit better. Is there an error being swallowed in the "short" form? Does it have memory implications? Something else? Thanks!

benfletcher commented 5 years ago

https://github.com/neumino/rethinkdbdash#optional-run-with-yield

Just missed this in docs.