top | item 11083446

(no title)

danielmewes | 10 years ago

> That's not what http://rethinkdb.com/docs/quickstart/ says. It shows a connection that exposes context-bound Builder methods with trigger (insert, changes, run, etc) methods.

I think the confusion stems from the fact that the Quickstart guide assumes that you're running queries in the Data Explorer, a web frontend for prototyping queries. In the Data Explorer, clicking the "Run" button is what triggers the execution of the AST.

If you wrote something like `r.table("tv_shows").insert(...)` in your application code, it wouldn't do anything except for returning an AST object. You can store that object, or call the `run(conn)` method on it to send it over a RethinkDB connection and execute it.

Note that the `r` object in these queries has no state. You can think of it as a namespace that serves as a starting point for building queries.

discuss

order

ssmoot|10 years ago

Ah. Thank you. Yes, that was definitely unclear to me.