ATX ATX 学习 (五)-数据库学习

阿凯 · 2019年05月25日 · 最后由 d182231609 回复于 2019年08月30日 · 1883 次阅读

前两天看到有人说想看一下 ATX 数据库的设计:
这里简单说一下,ATX 数据库 rethinkdb 目前来看是非常简单的,只有三张表

users 表

说明:
createdAt: 创建时间
email: 邮箱
lastLoggedInAt: 最后登录时间
secretKey: secretKey 密钥
token: token 登录
username: 用户姓名
admin: 是否是 admin

devices 表

createdAt: 创建时间
colding:
idleTimeout:
lastActivatedAt: 最后使用时间
owner:

platform: andriod 还是 IOS
properties.brand: 手机品牌
properties.model:
properties.name: 手机名称
properties.serial: 序列号
properties.version: andirod 版本
udid: 链接手机用的设备名
updatedAt:
userId: 使用者
using: 是否在使用
usingBeganAt: 开始使用时间
usingDuration: 已使用时长
sources: 用于存储连接过程中的一些连接信息
可以看一下内容:
"sources": {
"bb0e8300-7eb4-11e9-83ba-4cedfb458249": {
"atxAgentAddress": "172.16.2.243:20015" ,
"id": "bb0e8300-7eb4-11e9-83ba-4cedfb458249" ,
"name": "pyclient" ,
"owner": null ,
"priority": 2 ,
"remoteConnectAddress": "172.16.2.243:20017" ,
"secret": "DX6640747M" ,
"url": http://172.16.2.243:3500, »
"whatsInputAddress": "172.16.2.243:20016"
}
} ,

groups 表:

暂时没发现这张表的用途

怎么操作

这里简单说一下,不知道的可以去 google 一下

1.查表:

r.db('atxserver2').table('devices')

2.查询表中某个字段的值

r.db('atxserver2').table('devices')('owner')

3.使用主键进行查询

r.db('atxserver2').table('devices').get('F8UDU15131003748')

4.rethinkdb 的 API 接口,网上没找到它的 api 接口文档,有需要的在这里看吧

共收到 4 条回复 时间 点赞
阿凯 ATX 学习 (四)-atxserver2 中提及了此贴 05月25日 15:53

速度真赞~

groups 这个表是用来进行人员分组管理用的。设备可以设置为私有化,并只让某个组的人可见。不过还不太完善。

codeskyblue 回复

好的 谢谢解答@codeskyblue

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册