Questions tagged [reql]

ReQL is the RethinkDB query language. It offers a convenient way to manipulate JSON documents.

ReQL is the RethinkDB query language. It offers a convenient way to manipulate JSON documents.

http://www.rethinkdb.com/docs/introduction-to-reql/

99 questions
0
votes
1 answer

Filtering database entries by Author & between unix timestamp

I've been stuck on trying to find a way to get all database entries from a specific author ID and between 2 timestamps. I've tried reading the documentation and messing around with the ways demonstrated and can't figure it out. For example: getting…
0
votes
1 answer

How can I filter if any value of an array is contained in another array in rethinkdb/reql?

I want to find any user who is member of a group I can manage (using the webinterface/javascript): Users: { "id": 1 "member_in_groups": ["all", "de-south"] }, { "id": 2 "member_in_groups": ["all", "de-north"] } I…
anli
  • 515
  • 6
  • 9
0
votes
1 answer

ReQL : Filtering Documents from Python List of Strings

I'd to like to filter a table with ReQL using a (Python) list of strings (variable number of values) applied on several fields, ie in the logic of more strings in the list more result is accurate. Ideally the filtering should be case…
Tom
  • 63
  • 1
  • 8
0
votes
1 answer

php-rql selection command

I want to select some rows in users table which their ages are under 35. I wrote the code below but it doesn't work. $cursor = r\table('users')->filter('age' < 35)->pluck(array('name','family','age'))->run($conn); unfortunately, after execution…
milad
  • 93
  • 1
  • 6
0
votes
1 answer

Rethink merge array

I have a query - r.table('orgs') .filter(function(org) { return r.expr(['89a26384-8fe0-11e8-9eb6-529269fb1459', '89a26910-8fe0-11e8-9eb6-529269fb1459']) .contains(org('id')); }) .pluck("users") This…
Bopsi
  • 2,090
  • 5
  • 36
  • 58
0
votes
1 answer

ReQL equivalent of Select * from table where id in ()

I am new to RethinkDB, I have an array of object ids, I want to fetch object from a table whose id belong to this array. SQL query would be - SELECT * FROM orgs WHERE id IN ('ID1','ID2'); I tried following in myREQL console-…
Bopsi
  • 2,090
  • 5
  • 36
  • 58
0
votes
1 answer

Program method works syncrounously but exists with status code -1 for async counterpart

I am using rethinkdb and I am trying to delete all records in a table. The query works without problems when using the Run on the query , thus synchronously. When using the RunAsync the program exits with status code -1. The program does not throw…
Bercovici Adrian
  • 8,794
  • 17
  • 73
  • 152
0
votes
1 answer

How to send multiple arguments to Filter inner function in RethinkDB

Hello i need somehow to pass the filter method 2 or more arguments. Something like r.table("N/A").filter(function(arg1,arg2){..code here}) I need it for the following: I have a data structure like the…
Bercovici Adrian
  • 8,794
  • 17
  • 73
  • 152
0
votes
1 answer

RethinkDB: Check if object in array exist and replace it

I have this JSON document: { userId: xx, followedAuthors: [ { authorId: abc, timestamp: 123 }, { authorId: xyz, timestamp: 456 }, ] } When a user want to follow an author I would like to write a query that check if that author is…
Tres
  • 571
  • 1
  • 5
  • 19
0
votes
1 answer

Rethinkdb Append says attribute doesn't exist when it does

I've been creating a database with Rethinkdb. Here is my database format: { "Email": blah@blah.com, » "Password": "totallyahash1234" , "UserName": "CoolDude3" , "id": "6a4bb963-687a-48c2-b3f0-2e91965d3515" , "Projects": { "Project1": { …
Kalebot
  • 3
  • 1
0
votes
1 answer

Converting an array into an object with REQL

I'm looking for the most concise way to convert an array to an object while plucking the field used as the key for each result. This is the solution I found, and I'm wondering if there's an easier way. r.table('product').fold({}, function(products,…
aleclarson
  • 18,087
  • 14
  • 64
  • 91
0
votes
1 answer

How Should Complex ReQL Queries be Composed?

Are there any best practices or ReQL features that that help with composing complex ReQL queries? In order to illustrate this, imagine a fruits table. Each document has the following structure. { "id": 123, "name": "name", "colour":…
Chris Talman
  • 1,059
  • 2
  • 14
  • 24
0
votes
1 answer

Rethinkdb getField() gives an error

This is the error: toJSON` takes 0 argument, 1 provided after:\nr.table(\"users\").get(\"c62b27da-c0c2-4bfd-bd77-aaa95f215ec5\")(\"account\")" This is my code: `const userId = hook.params.user.id; const r = this.options.r; const…
Bahram
  • 11
  • 2
0
votes
1 answer

Nodejs get two joined tables in rethinkdb

I'd like to join two tables and write get url with joined table (make get, post, delete on joined table). I know how to do it with single table (e.g.): app.get('/employees', (req, res) => { r.table('employees').run(connection).then((cursor) =>…
0
votes
1 answer

How can I perform a map-reduce on filtered groups in RethinkDB?

I have a RethinkDB table consisting of Robinhood Stock Orders. The relevant fields are: side (either buy or sell) state (I'm only looking for filled orders) price (Average USD price of the order) quantity (Number of shares sold or purchased) I'm…
lightyrs
  • 2,809
  • 2
  • 29
  • 32