【发布时间】:2015-04-16 14:37:38
【问题描述】:
我在我的一个项目中使用 peewee 并且来自 Django 背景,我非常喜欢它。
我计划在 postgres 9.4 中广泛使用新引入的 JSONB。但是,我不知道如何使用 JSONB 键执行连接操作。
我认为一个例子对整个社区来说都是极好的。
【问题讨论】:
标签: peewee postgresql-9.4 jsonb
我在我的一个项目中使用 peewee 并且来自 Django 背景,我非常喜欢它。
我计划在 postgres 9.4 中广泛使用新引入的 JSONB。但是,我不知道如何使用 JSONB 键执行连接操作。
我认为一个例子对整个社区来说都是极好的。
【问题讨论】:
标签: peewee postgresql-9.4 jsonb
你可以这样写:
User.select().join(Metadata, on=Metadata.data['user_id'] == User.id)
Metadata.data 是一个 JSON 字段。
【讨论】: