sample

molecule.boilerplate.api.KeywordsStable.sample
trait sample extends AggrKw

Sample attribute value(s).

Apply sample keyword to attribute to return a single sample (random) attribute value of entities matching the molecule.

for {
 _ <- Person.age.insert(25, 34, 37, 42, 70)
 _ <- Person.age(sample).get.map(_.head ==> 42) // or other..
} yield ()

Apply sample(n) to return Vector of up to n distinct sample values.

Person.age(sample(3)).get.map(_.head ==> Vector(70, 25, 37)) // or other..

Attributes

Note

Can at most return the number of values that match.

Source
Keywords.scala
Graph
Supertypes
trait AggrKw
trait Kw
class Object
trait Matchable
class Any
Known subtypes
object sample.type

Members list

Grouped members

aggregates

def apply(n: Int): samples

Distinct sample values of attribute.

Apply sample(n) to an attribute to return a Set of up to n sample values.

Distinct sample values of attribute.

Apply sample(n) to an attribute to return a Set of up to n sample values.

for {
 _ <- Person.age.insert(25, 34, 37, 42, 70)
 _ <- Person.age(sample(3)).get.map(_.head ==> Vector(42, 25, 42)) // or other..
} yield ()

Attributes

Returns

List[attribute-type]

Note

Can at most return the number of values that match.

Source
Keywords.scala