count

molecule.boilerplate.api.KeywordsStable.count
trait count extends AggrCoalesce, AggrInt

Count of attribute values.

Apply count keyword to attribute to return count of attribute values of entities matching the molecule.

for {
 _ <- Person.firstName.lastName.age insert List(
   ("Ben", "Hayday", 42),
   ("Liz", "Taylor", 34),
   ("Liz", "Swifty", 34),
   ("Liz", "Mooray", 25)
 )
 _ <- Person.firstName.age(count).get.map(_ ==> List(
   ("Ben", 1),
   ("Liz", 3) // 34, 34, 25
 ))
} yield ()

Attributes

Returns

Int

Source
Keywords.scala
Graph
Supertypes
trait AggrInt
trait AggrCoalesce
trait AggrKw
trait Kw
class Object
trait Matchable
class Any
Show all
Known subtypes
object count.type
In this article