寻找一些关于如何为图形网络可视化构建mongo查询的方向。
我有一个数据模型,看起来像这样:
stories[
{
story: "story 1",
theme_ids: [1,2,3],
author_ids: [a,b,c]
},
{
story: "story 2",
theme_ids: [4],
author_ids: [a]
}
...
]我希望查询的结果能够获取所有的主题和作者对,如下所示:
[
{from: 1, to: a},
{from: 1, to: b},
{from: 1, to: c},
{from: 2, to: a},
{from: 2, to: b},
{from: 2, to: c},
{from: 3, to: a},
{from: 3, to: b},
{from: 3, to: c},
{from: 4, to: a}
]谢谢!MongoDB v3.4
https://stackoverflow.com/questions/51586727
复制相似问题