$setOnInsert
A set that only applies when an upsert is an insert. The query below will create an initialized record but avoid resetting the count if the record already exists. Example:
User.where(_._id eqs uid).modify(_.impressionCount setOnInsertTo 0).upsertOne()
'eqs' on List fields
Ability to test a list field for strict equality. Compare to $all.
User.where(_._id eqs uid).and(_.tags eqs List("LocalSales", "ThirdParty"))
$push/$each/$slice
Push items into a list while keeping the list a fixed size. For example, this rogue query:
User.where(_._id eqs uid).modify(_.lastImpressions push (iids, -5))
produces the following modify expression:
{ $push: { lastImpressions: { $each: [ ... ], $slice: -5 }}
This limits the list to the last 5 elements. The $slice value must be zero or negative.