rethinkdb-ruby

RethinkDB multiple queries in a single request

笑着哭i 提交于 2020-01-13 08:45:10
问题 I'm trying to execute several RQL commands in a single request to server, without much success I may add. I have tried r.union , but it only works with sequences. What I really want: [r.db(..).table(..).get(id1).delete(), r.db(..).table(..).get(id2).delete(), r.db(..).table(..).insert(...)].run_all_at_once Is there any way to do this? Thanks! 回答1: You can do r.expr( [r.db(...).table(...).get(id1).delete(), r.db(...).table(...).get(id1).delete(), r.db(...).table(...).insert(...) ] ).run(conn)

How would you use map reduce on this document structure?

こ雲淡風輕ζ 提交于 2019-12-11 19:26:14
问题 If I wanted to count foobar.relationships.friend.count, how would I use map/reduce against this document structure so the count will equal 22. [ [0] { "rank" => nil, "profile_id" => 3, "20130913" => { "foobar" => { "relationships" => { "acquaintance" => { "count" => 0 }, "friend" => { "males_count" => 0, "ids" => [], "females_count" => 0, "count" => 10 } } } }, "20130912" => { "foobar" => { "relationships" => { "acquaintance" => { "count" => 0 }, "friend" => { "males_count" => 0, "ids" => [

Rethink DB Cross Cluster Replication

岁酱吖の 提交于 2019-12-11 10:59:51
问题 I have 3 different pool of clients in 3 different geographical locations. I need configure Rethinkdb with 3 different clusters and replicate data between the (insert, update and deletes). I do not want to use shard, only replication. I didn't found in documentation if this is possible. I didn't found in documentation how to configure multi-cluster replication. Any help is appreciated. 回答1: I think that multi cluster is just same a single clusters with nodes in different data center First, you