Fwd: rogue 2.3.0

46 views
Skip to first unread message

Jason Liszka

unread,
Mar 5, 2014, 6:15:34 PM3/5/14
to rogue...@googlegroups.com
Some new features:

$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.



Reply all
Reply to author
Forward
0 new messages