Actually use $not correctly

deepcrayonfish^2
Benedikt Werner 2021-11-13 22:37:08 +01:00
parent f46dc7536f
commit 384cc4493e
No known key found for this signature in database
GPG Key ID: 1DBFF0F8E9E121EB
1 changed files with 1 additions and 1 deletions

View File

@ -174,7 +174,7 @@ final class UserRepo(val coll: Coll)(implicit ec: scala.concurrent.ExecutionCont
.update(ordered = false, WriteConcern.Unacknowledged)
.one(
// limit to -3 <= colorIt <= 5 but set when undefined
$id(userId) ++ $not(if (value < 0) $doc(F.colorIt $lte -3) else F.colorIt $gte 5),
$id(userId) ++ $doc(F.colorIt -> $not(if (value < 0) $lte(-3) else $gte(5)))),
$inc(F.colorIt -> value)
)
.unit