trait rand extends AnyRef
Random attribute value(s).
Apply random
keyword to attribute to return a single random attribute of entities matching the molecule.
Person.age.insert(25, 34, 37, 42, 70) Person.age(random).get.head === 34 // or other..
Apply random(n)
to return Vector of n random values. Observe though that duplicate random values can re-occur.
Person.age(random(3)).get.head === Vector(42, 25, 42) // or other..
To get distinct values only, use the sample(n)
keyword instead.
- Source
- AggregateKeywords.scala
- Grouped
- Alphabetic
- By Inheritance
- rand
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def apply(i: Int): rands
Random values of attribute.
Random values of attribute.
Apply a number n torandom
to return Stream of n random attribute values of from entities matching the molecule.
Observe that duplicate random values can re-occur.Person.age.insert(25, 34, 37, 42, 70) Person.age(random(3)).get.head === Stream(42, 25, 42) // or other..
To get distinct values only, use the
sample(n)
keyword instead.- returns
List[attribute-type]
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
Inherited from AnyRef
Inherited from Any
Aggregate keywords
Keywords applied to attributes that return aggregated value(s).
Documentation/API for the Molecule library - a meta DSL for the Datomic database.
Manual | scalamolecule.org | Github | Forum