Collection

lightdb.collection.Collection
See theCollection companion object
case class Collection[Doc <: Document[Doc], Model <: DocumentModel[Doc]](name: String, model: Model, loadStore: () => Store[Doc, Model], maxInsertBatch: Int, cacheQueries: Boolean) extends Initializable

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Self type
Collection[Doc, Model]

Members list

Type members

Classlikes

object t

Convenience feature for simple one-off operations removing the need to manually create a transaction around it.

Convenience feature for simple one-off operations removing the need to manually create a transaction around it.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
t.type
object transaction

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
object trigger extends CollectionTriggers[Doc]

Attributes

Supertypes
class CollectionTriggers[Doc]
trait CollectionTrigger[Doc]
class Object
trait Matchable
class Any
Self type
trigger.type

Value members

Concrete methods

def apply[V](f: Model => (UniqueIndex[Doc, V], V))(implicit transaction: Transaction[Doc]): Doc
def apply(id: Id[Doc])(implicit transaction: Transaction[Doc]): Doc
def count(implicit transaction: Transaction[Doc]): Int
def delete[V](f: Model => (UniqueIndex[Doc, V], V))(implicit transaction: Transaction[Doc]): Boolean
def delete(id: Id[Doc])(implicit transaction: Transaction[Doc], ev: Model <:< DocumentModel[_]): Boolean
def dispose(): Unit
def exists(id: Id[Doc])(implicit transaction: Transaction[Doc]): Boolean
def get[V](f: Model => (UniqueIndex[Doc, V], V))(implicit transaction: Transaction[Doc]): Option[Doc]
def get(id: Id[Doc])(implicit transaction: Transaction[Doc]): Option[Doc]
def getAll(ids: Seq[Id[Doc]])(implicit transaction: Transaction[Doc]): Iterator[Doc]
def getOrCreate(id: Id[Doc], create: => Doc, lock: Boolean)(implicit transaction: Transaction[Doc]): Doc
def insert(doc: Doc)(implicit transaction: Transaction[Doc]): Doc
def insert(docs: Seq[Doc])(implicit transaction: Transaction[Doc]): Seq[Doc]
def iterator(implicit transaction: Transaction[Doc]): Iterator[Doc]
def list()(implicit transaction: Transaction[Doc]): List[Doc]
def modify(id: Id[Doc], lock: Boolean, deleteOnNone: Boolean)(f: Option[Doc] => Option[Doc])(implicit transaction: Transaction[Doc]): Option[Doc]
def reIndex(): Boolean
def truncate()(implicit transaction: Transaction[Doc]): Int
def upsert(doc: Doc)(implicit transaction: Transaction[Doc]): Doc
def upsert(docs: Seq[Doc])(implicit transaction: Transaction[Doc]): Seq[Doc]
def verify(): Boolean

Inherited methods

final def init(): Boolean

Calls initialize() exactly one time. Safe to call multiple times.

Calls initialize() exactly one time. Safe to call multiple times.

Attributes

Inherited from:
Initializable
def isInitialized: Boolean

Attributes

Inherited from:
Initializable
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product

Concrete fields

lazy val query: Query[Doc, Model]
lazy val store: Store[Doc, Model]