run queries to rethinkdb