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
1
vote
1 answer

Rethinkdb - PHP-RQL - Http api - filter response

I'm working through several tutorials and examples on Rethinkdb and converting them to PHP-RQL for my own learning. I'm currently looking at http://www.infoworld.com/article/2975838/database/build-real-time-web-apps-with-rethinkdb.html and can't…
Chris Hunt
  • 105
  • 5
1
vote
1 answer

RethinkDB REQL Query to find number occurrences of distinct values in an array

I have a table like this in rethinkDB. [{ "Id": [ 12, 13 ], "group": "79", "go_Id": [] }, { "Id": [ 12, 12, 12, 14 14 ], "group": "91", "go_Id": [ 16, …
1
vote
2 answers

rethinkDB pluck generated_key from insert python

Essentially, I'm trying to get the generated key for a single record insert. Something like: rethinkdb.table('test').insert(request.data).pluck('generated_keys')[0].run(connection) and have it return something like: { "id":…
Carl Sagan
  • 982
  • 1
  • 13
  • 34
1
vote
1 answer

Why does my simple Rethinkdb query fail when using a lambda?

I'm testing out some queries in the Data Explorer window. I'm trying to construct some basic queries using lambdas, but these queries fail. For example, this query works: r.db('libstats').table('flowcells').filter( {barcode: 'H3YTYCCXX'} ) But…
DeeDee
  • 2,641
  • 2
  • 17
  • 21
1
vote
1 answer

RethinkDB: Get only one record from cursor/selection

If I have a query that returns multiple results, how do I get a single element from the selection? e.g. r.db("test").table("things") // returns an array of things. I want one of them Using limit(1) is not what I want because that returns an array.
mark
  • 1,953
  • 1
  • 24
  • 47
1
vote
1 answer

Grouping and Counting arrays in rethinkdb

I have json data as follows: { "artist": { "aliases": { "name": "Thaddeuz Anderson" } , "data_quality": "Correct" , "id": 2377 , "name": "DJ Thadz" , "namevariations": { "name": [ "D. J. Thadz" , …
user4542931
1
vote
0 answers

RethinkDB get all and order with index

I have an object like this: Company { Enable bool Pro bool Type int Categories []int } So, how can I make query to retrieve all objects that Enable=true, Categories contains, for example, "1" and order by Pro and Type. I have more than…
Alex
  • 795
  • 2
  • 9
  • 17
1
vote
2 answers

Rethinkdb Array of Object to Object of Array

I'm trying to work with Rethinkdb in mapreducing something like: [{"a":1, "b":2}, {"a":3}, {"c":4}] to {"a":[1,3], "b":[2], "c":[4]}. I have already consulted Javascript: How convert array of objects to object with sorted unique arrays? but the…
Xrave
  • 85
  • 1
  • 8
1
vote
1 answer

How to append to possibly non-existent subdocument in RethinkDB?

I have a JSON schema that validates documents like this: { "id": "abc123", ... "galleries": { : { "items": [], "visible": true } } } The "galleries" part is not required by the…
3k-
  • 2,467
  • 2
  • 23
  • 24
1
vote
1 answer

Returning sub attributes in Rethinkdb

Given this document: { "Country": { "ISO-3166-1-Alpha-2": "AD" , "ISO-3166-1-Alpha-3": "AND" , "ISO-3166-1-Numeric": 20 , "ISO-3166-2": "ISO 3166-2:AD" , "LongNames": { "en-us": "Andorra" } , "ShortNames": { "en-us": "Andorra" } , "WebName": …
Alan
  • 45,915
  • 17
  • 113
  • 134
0
votes
0 answers

Node CLI commands through kubectl exec pod_name --

I am trying to build a script, which would be running database queries on a pod, after loading node CLI. Manually, i run kubectl exec pod_name -- node test.js, and that would give me a CLI and I run my queries there. Is there a way I can add this…
Sugesh Nair
  • 91
  • 1
  • 6
0
votes
0 answers

ReQL: Merging two objects based on a common property

I have one query that returns an array of objects that looks like this, where the same group of customers get returned every time (limiting my example to 2 customers for brevity): [ { "customer": "cust1", "date": 2023-03-03, …
Chris
  • 1,273
  • 5
  • 19
  • 33
0
votes
0 answers

RethinkDB Limit rows a user can create

I want to limit the rows a user can create inside a table, I already tried to check the count before inserting but that wouldnt work if multiple inserts happen at the same time Code with the earlier mentioned…
Nighrix
  • 1
  • 1
  • 1
0
votes
1 answer

Merge subarrays and sort

I have ReQL query r.table('production_plan') .filter(doc => doc.hasFields('messages')) .pluck('id', 'nomer','diameter', {'messages': ['date', 'text','username']}) with results { "diameter": 160, "id":…
0
votes
1 answer

Regarding connection class in RethinkDb

I am not able to understand why am I getting this error stating that connection of type Connection is not initialized if anyone could help me out with it. enter image description here