rethinkdb

How to join tables with a array of IDs

为君一笑 提交于 2019-11-30 15:05:59
问题 Attempting to use this example to join on an array of IDs: https://github.com/rethinkdb/rethinkdb/issues/1533#issuecomment-26112118 Stores table snippet { "storeID": "80362c86-94cc-4be3-b2b0-2607901804dd", "locations": [ "5fa96762-f0a9-41f2-a6c1-1335185f193d", "80362c86-94cc-4be3-b2b0-2607901804dd" ] } Locations table snippet { "lat": 125.231345, "lng": 44.23123, "id": "80362c86-94cc-4be3-b2b0-2607901804dd" } I'd like to select the stores and join their store locations. Original example from

How to use getall with orderby in RethinkDB

拟墨画扇 提交于 2019-11-30 13:21:55
问题 i want to list records where id=1 between two timestamps and finally order them according to timestamp. Mysql query something: Select * from test where (timestamp between 100099323 AND 1423699323) AND id=1 order by timestamp there are more than 5 million documents in rethink database. I tried using index for the simple mysql query: Select * from test where id=1 order by timestamp and Rethinkdb query is: r.table('test').getAll(1, {index: 'id'}).orderBy({index: 'timestamp'}) but i am getting

How to join tables with a array of IDs

微笑、不失礼 提交于 2019-11-30 13:10:50
Attempting to use this example to join on an array of IDs: https://github.com/rethinkdb/rethinkdb/issues/1533#issuecomment-26112118 Stores table snippet { "storeID": "80362c86-94cc-4be3-b2b0-2607901804dd", "locations": [ "5fa96762-f0a9-41f2-a6c1-1335185f193d", "80362c86-94cc-4be3-b2b0-2607901804dd" ] } Locations table snippet { "lat": 125.231345, "lng": 44.23123, "id": "80362c86-94cc-4be3-b2b0-2607901804dd" } I'd like to select the stores and join their store locations. Original example from ReThinkDB contributor: r.table("blog_posts") .concat_map(lambda x: x["comment_ids"].map(lambda y: x

How to use getall with orderby in RethinkDB

∥☆過路亽.° 提交于 2019-11-30 07:12:36
i want to list records where id=1 between two timestamps and finally order them according to timestamp. Mysql query something: Select * from test where (timestamp between 100099323 AND 1423699323) AND id=1 order by timestamp there are more than 5 million documents in rethink database. I tried using index for the simple mysql query: Select * from test where id=1 order by timestamp and Rethinkdb query is: r.table('test').getAll(1, {index: 'id'}).orderBy({index: 'timestamp'}) but i am getting error: RqlRuntimeError: Indexed order_by can only be performed on a TABLE or TABLE_SLICE in: r.table(

rql get multiple documents from list of keys rethinkdb in javascript

耗尽温柔 提交于 2019-11-30 03:29:31
问题 I have a table of "person" data, which has a unique key "id". I have a list of id's that I want to get the data for which I'll be sending as a JSON array from the client to the server. The serve recieves that data as a JSON array. Now is there a way to run a query that will get the documents for each of those ids? Or is my only option to parse the ids myself and build an array of results, then send that array back. So far I've tried using... getAll - but I cannot get this to work because it

Docker集中化web界面管理平台shipyard

早过忘川 提交于 2019-11-27 06:41:53
Shipyard ( github )是建立在docker集群管理工具 Citadel 之上的可以管理容器、主机等资源的web图形化工具。包括 core 和 extension 两个版本,core即shipyard主要是把多个 Docker host上的 containers 统一管理(支持跨越多个host),extension即shipyard-extensions添加了应用路由和负载均衡、集中化日志、部署等。 1. 几个概念 engine 一个shipyard管理的docker集群可以包含一个或多个engine(引擎),一个engine就是监听tcp 端口的docker daemon。shipyard管理docker daemon、images、containers完全基于Docker API,不需要做其他的修改。另外,shipyard可以对每个engine做资源限制,包括CPU和内存;因为TCP监听相比Unix socket方式会有一定的安全隐患,所以shipyard还支持通过SSL证书与docker后台进程安全通信。 rethinkdb RethinkDB是一个shipyard项目的一个docker镜像,用来存放账号(account)、引擎(engine)、服务密钥(service key)、扩展元数据(extension metadata)等信息

PostgreSQL是不是你的下一个JSON数据库?

蓝咒 提交于 2019-11-26 20:01:15
根据 Betteridge 定律(任何头条的设问句可以用一个词来回答:不是),除非你的JSON数据很少修改,并且查询很多。 最新版的PostgreSQL添加更多对JSON的支持,我们曾经问过PostgreSQL是否可以替换MongoDB作为JSON数据库,答案显而易见,但我们更希望的是,啊哈,这个问题由读者来问了。 “PostgreSQL不是已经有一些json的支持了吗?” 是的,在PostgreSQL 9.4之前的版本也有JSON 数据类型了,你可以这样: CREATE TABLE justjson ( id INTEGER, doc JSON) >INSERT INTO justjson VALUES ( 1, '{ "name":"fred", "address":{ "line1":"52 The Elms", "line2":"Elmstreet", "postcode":"ES1 1ES" } }'); 保存了JSON的原始文本到数据库,包括空白行和键顺序及重新的键,我们来查看下保存的数据: >SELECT * FROM justjson; id | doc ----+--------------------------------- 1 | { + | "name":"fred", + | "address":{ + | "line1":"52 The Elms",