Questions tagged [rethinkdb-python]

Python driver for RethinkDB

128 questions
45
votes
3 answers

How to remove a key from a RethinkDB document?

I'm trying to remove a key from a RethinkDB document. My approaches (which didn't work): r.db('db').table('user').replace(function(row){delete row["key"]; return row}) Other approach: r.db('db').table('user').update({key: null}) This one just…
Robert Zaremba
  • 6,780
  • 6
  • 40
  • 71
19
votes
1 answer

How to append an element to an array in rethinkdb

I have this object: { "id": "eb533cd0-fef1-48bf-9fb8-b66261c9171b" , "errors": [ "error1" , "error2" ] } I simply want to append a new error to errors array. I…
Sincere
  • 477
  • 5
  • 17
7
votes
1 answer

RethinkDB losing data after restarting server

I save my data on RethinkDB Database. As long as I dont restart the server, all is well. But when I restart, it gives me an error saying database doesnt exist, although the folder and data does exist in folder rethinkdb_data. What is the problem ?
Prateek Narendra
  • 1,514
  • 1
  • 26
  • 50
5
votes
1 answer

How do I create a compound multi-index in rethinkdb?

I am using Rethinkdb 1.10.1 with the official python driver. I have a table of tagged things which are associated to one user: { "id": "PK", "user_id": "USER_PK", "tags": ["list", "of", "strings"], // Other fields... } I want to…
tawmas
  • 5,995
  • 3
  • 23
  • 23
4
votes
1 answer

How to filter on array size in rethinkdb?

I have a table with a bunch of documents that are updated regularly (in part). What I'm essentially trying to do is create another table (called changes below) that stores the latest N changes to each of those documents. I'm thus doing…
pythonator
  • 377
  • 2
  • 10
4
votes
3 answers

rethinkdb: "RqlRuntimeError: Array over size limit" even when using limit()

I'm trying to access a constant number of the latest documents of a table ordered by a "date" key. Note that the date, unfortunately, was implemented (not by me...) such that the value is set as a string, e.g "2014-01-14", or sometimes "2014-01-14…
Kludge
  • 2,305
  • 4
  • 18
  • 35
3
votes
0 answers

How do I configure a custom data store for Flask-Security?

I would like to use Flask-Security with RethinkDB, but I cannot get my custom RethinkDBUserDatastore to work properly. Below is the code I've created for the custom data store, plus the adapted example app from the Flask-Security…
3
votes
1 answer

"rethinkdb.errors.ReqlServerCompileError: Expected 2 arguments but found 1 in:" when trying to .update() with Python rethink

I'm working with RethinkDB using the Python module and right now I'm trying to update a model with this statement: results = rethink.table(model + "s").filter(id=results["id"]).update(data).run(g.rdb_conn) model is something being defined earlier…
RPiAwesomeness
  • 4,319
  • 6
  • 30
  • 46
3
votes
1 answer

How to create a parallel loop using aiohttp or asyncio in Python?

I would like to use rethinkdb .changes() feature to push some messages to users. The messages should send without any requests from the users. I am using rethinkdb with aiohttp and websockets. How it works: User sends message Server puts it into…
3
votes
2 answers

RethinkDB max file size attachments (BLOB)

I found in documentation that RethinkDB can store Binary Files (BLOBs). This is great ! I have an ECM application and need to store 50.000.000 of files. ( from 8K until 1GB ). I need to know what is the max file size in RethinkDB ? Will be some…
Carlos
  • 51
  • 1
  • 1
3
votes
1 answer

Using RethinkDB for "Full Text Search"

I am currently working on a web application where, ideally, I would be able to support a search bar on the documents that are going to be stored for users. Each of these documents is going to be a small snippet up to a decently-sized article. (I…
Freezerburn
  • 993
  • 2
  • 10
  • 27
2
votes
2 answers

Is pymongo asyncronous?

I work on a benchmark between pymongo and rethinkdb, to compare the time took for insertions. However this is what I found : for one-by-one insertions. def chronometre_rethink_insert_one(data, nblines): avant = time() for i in…
Ezriel_S
  • 195
  • 1
  • 5
2
votes
1 answer

How do I delete/update from nested document array

Given a document as below how can I delete or update from the nested document ingredients ? Any help, I am new to this rethinkdb. The table stores this documents called recipes. [ { "cook": "9 min", "id":…
Arup Rakshit
  • 109,389
  • 25
  • 234
  • 293
2
votes
1 answer

Rethinkdb: returning more than one object from a query

I have a table with some rows that look like this: { "id": "12345" "created_date": Fri May 27 2016 22:06:25 GMT+00:00 , "image": true } { "id": "6789" "created_date": Mon May 30 2016 07:48:35 GMT+00:00 , "video": true }{ "id":…
ApathyBear
  • 6,991
  • 12
  • 48
  • 84
2
votes
2 answers

RethinkDB insert and conflict resolution function syntax

I'm trying to learn how to use the lambda function to resolve conflicts when inserting into a table with rethinkdb and python, like the last example on this page. I would like to compare a timestamp field between the old_doc and new_doc and keep the…
chacalle
  • 33
  • 5
1
2 3
8 9