Python driver for RethinkDB
Questions tagged [rethinkdb-python]
140 questions
0
votes
0 answers
Cannot "make" the RethinkDb from the source
I was trying to install RethinkDb on a fresh debian instance(from google cloud) which has around 1.7gb memory and 10gb storage. Everything till configure went great but i got this error while running the make command!
[1/306] CC…

AXVin
- 1
- 2
0
votes
1 answer
Rethinkdb: search a string in whole table (full text search like)
I'm writing a python flask application in combination with rethinkDB.
snippit structure:
{'Name': ['Gandalf', 'Jackson'], 'street': 'elmStreet'...}
This kind of structure is used multiple times, so basically I have all my keys as a string and my…

SeanJohn
- 1
- 1
0
votes
2 answers
How would I check if a filtered request returns an empty array?
I started Javascript around a year and a half ago but I started Python around a week ago so I'm still a beginner at this. So I'm trying to figure out if a user is already stored into the users table and if they aren't then it will add them to it and…

InternalCosmos
- 3
- 3
0
votes
1 answer
Is there any builtin mechanism in rethinkdb to transform array of objects into key value?
I want to transform
[{"id": 1, "name": "some_name_1", "alias": "alias1"}, {"id": 2, "name": "some_name_2", alias: "alias2"}, {"id": 3, "name": "some_name_3", "alias": "alias3"}]
into
{"1": {"id": 1, "name": "some_name_1", "alias": "alias1"}, "2":…

David Mnatsakanyan
- 455
- 1
- 4
- 15
0
votes
2 answers
Filter documents based on value of an attribute inside an array of objects
RethinkDB newb here and I can't figure this one out.
Lets say I have a table named mydata with documents that have the following basic structure:
{
"SomeAttirbute": "SomeValue",
"team": [
{
"name": "john" ,
…

jay
- 53
- 1
- 5
0
votes
1 answer
RethinkDB - Automatically generating primary keys that are linear
Is there a way to make rethinkdb generate primary key automatically and to ensure the key is in an increasing order., like say 1 to n
I know when we insert a row into rethinkdb it automatically generates a primary key and returns a variable…

coderb
- 27
- 5
0
votes
1 answer
RethinkDB (Python) Change Feed - How to avoid blocking?
New to RethinkDB and want to make sure I'm getting this right.
Is a change feed in RethinkDb always blocking?
The following example is given in the docs (https://rethinkdb.com/docs/changefeeds/python/)
feed = r.table('users').changes().run(conn)
for…

user2095590
- 53
- 1
- 9
0
votes
2 answers
reformat string of index field when creating RethinkDB index
I am trying to create an index in RethinkDB.
The documents look like this:
{ "pinyin" : "a1 ai3"}
To make searching easier, I would like to preprocess the index entries and remove spaces and numbers, the entry thus should simply be "aai" in this…

Chris
- 13
- 3
0
votes
1 answer
Create multiple tables in same time on RethinkDB
I wrote a little script to create DB and some tables inside a RethinkDB if database don't exist.
I'm using the Python shell to communicate with RethinkDB
import rethinkdb as r
r.connect('localhost',…

Jérôme
- 1,966
- 4
- 24
- 48
0
votes
1 answer
Filtering a join based on foreign keys in list values in RethinkDB
I'm using RethinkDB (2.3.5~0trusty) and python (2.7.6) and python-rethinkdb
bindings (2.3.0.post6), and trying to query a pre-existing database.
(ie please assume I can't change the schema that I'm working with)
This is a simplified example of the…

Michael Sparks
- 634
- 5
- 9
0
votes
1 answer
Determine if field is an element of a set
Using RethinkDB's filter() function, given a field called field, how do we determine if field is an element of a set ['value1', 'value2'...'valueN'], and only filter rows where field is in such set?
One would be very pleased to see RethinkDB support…

The Aelfinn
- 13,649
- 2
- 54
- 45
0
votes
1 answer
Sum two fields in a nested array in RethinkDB
The following document exists in a table in RethinkDB:
{
u'destination_addresses':[
u'1 Rockefeller Plaza,
New York,
NY 10020,
USA',
u'Meadowlands,
PA 15301,
USA'
],
u'origin_addresses':[
…

nacc
- 311
- 3
- 8
0
votes
1 answer
RethinkDB update field inside nested array->obj
Here is how my row looks like:
{"id": x ,
"data": [
{
"someId": 1 ,
"url": https://twitter.com/HillaryClinton?ref_src=twsrc%5Egoogle%7Ctwcamp%5Eserp%7Ctwgr%5Eauthor, »
} ,
{
"someId": 2 ,
"url":…

Nema Ga
- 2,450
- 4
- 26
- 49
0
votes
1 answer
RethinkDB Join and Order using Python
I would like to join and order the field in RethinkDB. My tables and sample data is:
Category Table
{
"id": "2be434e0-0f34-4705-ba7f-560437a8e65c" ,
"name": "IT"
} {
"id": "76db46b7-2b1b-4c6e-99dd-83852d921ec0" ,
"name": "Electronic"
} {
"id": …

BloodKnight
- 9
- 3
0
votes
1 answer
Rethinkdb - Atomic retrieve/update row with specific condition
I have a bunch of celery workers that need to get single record(row) from the database.
It should only be returned if 60 seconds passed since "last_used" field and as soon as returned, it should update the "last_used" with current time(so other…

Nema Ga
- 2,450
- 4
- 26
- 49