rand
molecule.boilerplate.api.KeywordsStable.rand
Random attribute value(s).
Apply random
keyword to attribute to return a single random attribute of entities matching the molecule.
for {
_ <- Person.age.insert(25, 34, 37, 42, 70)
_ <- Person.age(random).get.map(_.head ==> 34) // or other..
} yield ()
Apply random(n)
to return Vector of n random values. Observe though that duplicate random values can re-occur.
Person.age(random(3)).get.map(_.head ==> Vector(42, 25, 42)) // or other..
To get distinct values only, use the sample(n)
keyword instead.
Attributes
- Source
- Keywords.scala
- Graph
-
- Supertypes
- Known subtypes
-
object rand.type
Members list
In this article