rethinkdb-python

How to remove a key from a RethinkDB document?

核能气质少年 提交于 2019-12-03 14:23:16
问题 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 sets row.key = null (which looks reasonable). Examples tested on rethinkdb data explorer through web UI. 回答1: Here's the relevant example from the documentation on RethinkDB's website: http://rethinkdb.com/docs/cookbook/python/#removing-a-field-from-a

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

两盒软妹~` 提交于 2019-12-01 21:32:13
问题 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 22:22:22". I'm getting a "RqlRuntimeError: Array over size limit 102173" error message when using the following query: r.db('awesome_db').table("main").orderBy(r.desc("date")) I tried to overcome this problem by specifying a constant limit, since

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

匆匆过客 提交于 2019-12-01 19:34:23
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 22:22:22". I'm getting a "RqlRuntimeError: Array over size limit 102173" error message when using the following query: r.db('awesome_db').table("main").orderBy(r.desc("date")) I tried to overcome this problem by specifying a constant limit, since for now I only need the latest 50: r.db('awesome_db').table("main").orderBy(r.desc("date")).limit(50)