Update relation module

pull/7020/head
Cédric Chantepie 2020-07-19 16:00:47 +02:00
parent 524b53bb89
commit bc1c7f5736
2 changed files with 9 additions and 7 deletions

View File

@ -47,12 +47,13 @@ final class RelationApi(
readPreference = ReadPreference.secondaryPreferred
) { framework =>
import framework._
Match(
$doc(
"$or" -> $arr($doc("u1" -> userId), $doc("u2" -> userId)),
"r" -> Follow
)
) -> List(
List(
Match(
$doc(
"$or" -> $arr($doc("u1" -> userId), $doc("u2" -> userId)),
"r" -> Follow
)
),
Group(BSONNull)(
"u1" -> AddFieldToSet("u1"),
"u2" -> AddFieldToSet("u2")

View File

@ -117,7 +117,8 @@ final private class RelationRepo(coll: Coll, userRepo: lila.user.UserRepo)(impli
$doc("u1" -> userId, "r" -> relation),
$doc("_id" -> true).some
)
.list[Bdoc](nb)
.cursor[Bdoc]()
.list(nb)
.dmap {
_.flatMap { _.string("_id") }
} flatMap { ids =>