【发布时间】:2014-10-25 11:14:00
【问题描述】:
假设我有一个故事表(带有示例数据):
story
{id: 1, name: 'First Story', tags: ['plants', 'flowers', 'dog']}
{id: 2, name: 'Second Story', tags: ['flowers', 'wedding']}
{id: 3, name: 'Third Story', tags: ['plants', 'wedding']}
故事表在tags 字段上有一个多重索引。
我可以获取所有带有plants 标签的故事:
r.table('story').getAll('plants', {index: tags})
现在我将如何以有效的方式(希望利用标签多索引)获得同时plants 和wedding 标签的所有故事?
该用例需要用户对任意数量的任意标签进行可选择的过滤。
【问题讨论】: