Return all items of a table in thinky

Thinky is a wonderful ORM for rethink DB. The docuementation is generally good but I couldn’t find a way to simply get all records from a single table.

I was thinking the answer should be something like:

1
2
3
MyModel.all().run().then(function(results) {
// ...
});

However, the all() isn’t a thing. The answer is simply to just execute the run().

1
2
3
MyModel.run().then(function(results) {
// ...
});

The rethinkdb syntax for the same query is similar so this behavior makes sense.

avatar

Dev Blog