0

I am running a RethinkDB using the Python driver.

Python Request:

response = r.db("user_data_sets").table("indexes").get_all(r.args(['key1', 'key2'])).run()

This request is only returning the key2 record in response.

> len(response.items)
> result = int(1)

If I run the query in the Data Explorer, I get both records.

Data Explorer Test Request:

r.db("user_data_sets").table("indexes").getAll(r.args(['key1', 'key2']))

2 rows returned. Displaying rows 1-2

I'm kinda at a loss here. Am not sure if this is a driver bug/issue, or a syntax quirk, or something else entirely. Google hasn't produced anything insightful.

getglad
  • 2,514
  • 3
  • 24
  • 47

1 Answers1

1

I just tested this and got the correct results:

RethinkDB Version:

rethinkdb 2.3.4 (CLANG 7.3.0 (clang-703.0.31))

RethinkDB Python module:

rethinkdb==2.1.0.post2

Here's my Python code:

r.db("test").table("so1").insert({"id":1}).run(conn)
r.db("test").table("so1").insert({"id":2}).run(conn)
list(r.db("test").table("so1").get_all(r.args([1, 2])).run(conn))
# [{'id': 2}, {'id': 1}]

And the results in the WebUI

example image

If you create an entirely new table, and just insert these two documents. Are the results the same?

dalanmiller
  • 3,467
  • 5
  • 31
  • 38
  • Yeah - I had just come across https://rethinkdb.com/api/python/to_array/ in the docs. That's exactly what they recommend for small sets. I think I was trying to use the cursor improperly – getglad Jul 08 '16 at 21:26
  • Let me know if you have any more questions @getglad! – dalanmiller Jul 08 '16 at 22:44