4 ms·
Awesome feedback! Let me try to address some of these questions here, before figuring out how to improve the tutorial. `r`: is the top level ReQL namespace th
by alexpopescu 14y ago
Awesome feedback!
Let me try to address some of these questions here, before figuring out how to improve the tutorial.
`r`: is the top level ReQL namespace that gives you access to the functions defined
r.db('name'): is accessing the 'test' database. RethinkDB supports multiple databases. You can specify which one to use on a per connection basis or for each query.
The 'test' database is a default database (in principle it's similar to MySQL's test database). Being the default also means that you don't need to use `.db('test')` in each query.
`run`: ReQL allows chaining multiple functions together. Basically creating a query is a bit like using a builder pattern. These chained ops are all sent to the server and executed on the database. There is a single roundtrip. Basically `run` tells the query builder: "now it's your time to do something for me".
As side comments
1. initially we added much more details about each query, but we ended up with quite a bit of text compared to short queries. We thought it would be more intuitive the reduce the description part and provide links to the API. It looks like that wasn't the best solution.
2. we chose to have the query pre-typed instead of having it part of the description only as we assumed mostly everyone would just copy paste it. Assumption proved incorrect!
Thanks a lot!
alex @ rethinkdb
- randomdrake 14y agoThanks Alex! Appreciate the response. I'm always learning but I was a special education teacher for a while too so I've got some perspective on getting people to understand things. In regards to your side comments: 1) If you feel like there's too much text compared to short queries, that's fine. I'm not there to write gigantic amounts of code. I'm there to learn and write a few little snippets to understand what I'm doing. 2) As I mentioned in my response to coffee, it's much better to actually type out the stuff as you go. It sinks in and immediately starts to develop a feel for writing in the language. Especially considering the non-traditional querying that you've come up with, I think it's very important to take baby steps and treat it as a new language. To continue along the language analogy: teach us each word so we know what the sentence actually says.
- alexpopescu 14y agoI appreciate your feedback. Really really helpful to us (you should see what it triggered on #irc ;-)