Query

lightdb.Query
See theQuery companion object
case class Query[Doc <: Document[Doc], Model <: DocumentModel[Doc], V](transaction: CollectionTransaction[Doc, Model], conversion: Conversion[Doc, V], filter: Option[Filter[Doc]], sort: List[Sort], offset: Int, limit: Option[Int], pageSize: Int, countTotal: Boolean, scoreDocs: Boolean, minDocScore: Option[Double], facets: List[FacetQuery[Doc]], optimize: Boolean)

Attributes

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

Members list

Value members

Concrete methods

def aggregate(f: Model => List[AggregateFunction[_, _, Doc]]): AggregateQuery[Doc, Model]
def clearFilters: Q
def clearLimit: Q
def clearSort: Q
def collection: Collection[Doc, Model]
def conversion[T](conversion: Conversion[Doc, T]): Query[Doc, Model, T]
def converted[T](f: Doc => T): Query[Doc, Model, T]
def count: Task[Int]
def countTotal(b: Boolean): Q
def distance[G <: Geo](f: Model => Field[Doc, List[G]], from: Point, sort: Boolean, radius: Option[Distance]): Query[Doc, Model, DistanceAndDoc[Doc]]
def docAndIndexes: Query[Doc, Model, MaterializedAndDoc[Doc, Model]]
def docs: Query[Doc, Model, Doc]
def facet(f: Model => FacetField[Doc], path: List[String], childrenLimit: Option[Int], dimsLimit: Option[Int]): Q
def facets(f: Model => List[FacetField[Doc]], childrenLimit: Option[Int], dimsLimit: Option[Int]): Q
def filter(f: Model => Filter[Doc]): Q
def filterOption(f: Model => Option[Filter[Doc]]): Q
def first: Task[V]
def firstOption: Task[Option[V]]
def grouped[F](f: Model => Field[Doc, F], direction: SortDirection): Stream[Grouped[F, Doc]]
def id: Query[Doc, Model, Id[Doc]]
def indexes: Query[Doc, Model, MaterializedIndex[Doc, Model]]
def json(f: Model => List[Field[Doc, _]]): Query[Doc, Model, Json]
def limit(limit: Int): Q
def materialized(f: Model => List[Field[Doc, _]]): Query[Doc, Model, MaterializedIndex[Doc, Model]]
def minDocScore(min: Double): Q
def model: Model
def offset(offset: Int): Q
def optimized: Q
def pageSize(size: Int): Q
def process(establishLock: Boolean, deleteOnNone: Boolean, safeModify: Boolean)(f: Forge[Doc, Option[Doc]]): Unit

Processes through each result record from the query modifying the data in the database.

Processes through each result record from the query modifying the data in the database.

Value parameters

deleteOnNone

whether to delete the record if the function returns None (defaults to true)

establishLock

whether to establish an id lock to avoid concurrent modification (defaults to true)

f

the processing function for records

safeModify

whether to use safe modification. This results in loading the same object twice, but should never risk concurrent modification occurring. (defaults to true)

Attributes

def scored: Q
def search: Task[SearchResults[Doc, Model, V]]
def sort(sort: Sort*): Q
def stream: Stream[V]
def streamPage: Stream[V]
def streamScored: Stream[(V, Double)]
def streamScoredPage: Stream[(V, Double)]
def toList: Task[List[V]]
def unOptimized: Q
def value[F](f: Model => Field[Doc, F]): Query[Doc, Model, F]

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product