Hi!
I’m looking at using Dgraph for a social network. I’ve been trying it out for a few hours and it seems great but I’ve stumbled upon a road block.
One of the things I need to be able to do is to query the most recent x
posts from a list of users that I follow. Note that it’s not the most recent x
posts of each person but the most recent x
across all of their posts.
To clarify a bit further, this is a simplified version of what I can currently get:
{
"me": {
"friends": [
{
"user2': {
"posts": [
{post10},
{post5},
...
]
}
},
{
"user3': {
"posts": [
{post9},
{post4},
...
]
}
},
{
"user4': {
"posts": [
{post8},
{post3},
...
]
}
},
]
}
}
What I need is something like this (assuming x = 4
):
{
"me": {
"posts": [
{post10},
{post9},
{post8},
{post5}
]
}
}
I have a feeling that it’s either I’m missing something basic or I need a complicated query to get what I need. If you guys can help me create a query for this, that would be great.