RethinkDB returns incorrect results in Data Explorer with r.row

122 views Asked by At

Environments tested in: RethinkDB 2.3.5 installed on Ubuntu Xenial, same tested on MacOS Sierra.

The below done on clean install with one record added to test database:

Screenshot

Dashboard Data Explorer exact match query without r.row does find the record.

 1 row returned. Displaying rows 1-1
{

    "id": "f26a33f4-5add-442e-93b6-5fb93e817fb8" ,
    "myfield1": 1 ,
    "myfield2": "content"

}

With Python3 it works with r.row:

>>> import rethinkdb
>>> conn = r.connect()
>>> r.db('test').table('test').filter(r.row['myfield1'] == 1).run(conn)
<rethinkdb.net.DefaultCursor object at 0x7f8a95839438 (done streaming):
 [{'myfield1': 1, 'myfield2': 'content', 'id': 'f26a33f4-5add-442e-93b6-5fb93e817fb8'}]>
>>> 

This means that data is set correctly.

However, Dashboard Data Explorer FAILS on filter with r.row: That's the result with "No records found" rather then expected "1 row returned. Displaying rows 1-1":

Failure Screenshot

Could you help me to find what's the correct way of working with r.row in Dashboard Data Explorer or confirm that it is actual bug (pretty major then)?

1

There are 1 answers

0
uzla On BEST ANSWER

Dashboard uses Javascript syntax and does not comprehend Python. So, the query shoudl be put in Javascript:

instead of Python syntax

r.db('test').table('test').filter(r.row['myfield1'] == 1)

Dashboard accespts Javascript syntax:

r.db('test').table('test').filter(r.row("myfield1").eq(1))