object MongoSource extends MongoSourceImpl
An object that exposes those MongoDb definitions for fetching data from collections by performing different type of read queries available such like find, count, distinct or aggregation. There are three exceptions in which the method also alters the data apart of reading it, which are the findOne and delete, replace or update.
- Source
- MongoSource.scala
- Alphabetic
- By Inheritance
- MongoSource
- MongoSourceImpl
- 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 aggregate[Doc](collection: MongoCollection[Doc], pipeline: Seq[Bson]): Observable[Document]
Aggregates documents according to the specified aggregation pipeline.
Aggregates documents according to the specified aggregation pipeline.
- Doc
the type that this collection will decode documents from.
- collection
the abstraction to work with a determined MongoDB Collection.
- pipeline
the aggregate pipeline.
- returns
an Observable of type Document, containing the result of the aggregation pipeline
- Definition Classes
- MongoSource → MongoSourceImpl
- def aggregate[A, B](collection: MongoCollection[A], pipeline: Seq[Bson], clazz: Class[B]): Observable[B]
Aggregates documents according to the specified aggregation pipeline.
Aggregates documents according to the specified aggregation pipeline.
- A
the type that this collection will decode documents from
- B
the returned type result of the aggregation
- collection
the abstraction to work with a determined MongoDB Collection
- pipeline
the aggregate pipeline
- clazz
the class to decode each document into
- returns
an Observable of type B, containing the result of the aggregation pipeline
- Definition Classes
- MongoSource → MongoSourceImpl
- def apply[Doc](collection: MongoCollection[Doc]): MongoSource[Doc]
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def count[Doc](collection: MongoCollection[Doc], filter: Bson, countOptions: CountOptions = DefaultCountOptions, retryStrategy: RetryStrategy = DefaultRetryStrategy): Task[Long]
Counts the number of documents in the collection that matched the query filter.
Counts the number of documents in the collection that matched the query filter.
- Doc
the type of the collection
- collection
the abstraction to work with the determined mongodb collection
- filter
a document describing the query filter
- countOptions
the options to apply to the count operation
- retryStrategy
defines the amount of retries and backoff delays for failed requests.
- returns
a Task with a long indicating the number of documents, the result can be -1 if the underlying publisher did not emitted any documents, or a failed one when emitted an error.
- Definition Classes
- MongoSource → MongoSourceImpl
- See also
com.mongodb.client.model.Filters
- def count[Doc](collection: MongoCollection[Doc], filter: Bson): Task[Long]
Counts the number of documents in the collection that matched the query filter.
Counts the number of documents in the collection that matched the query filter.
- Doc
the type of the collection
- collection
the abstraction to work with the determined mongodb collection
- filter
a document describing the query filter
- returns
a Task with a long indicating the number of documents the result will be -1 if the underlying publisher did not emitted any documents, or a failed one when emitted an error.
- Definition Classes
- MongoSource → MongoSourceImpl
- See also
com.mongodb.client.model.Filters
- def countAll[Doc](collection: MongoCollection[Doc], retryStrategy: RetryStrategy = DefaultRetryStrategy): Task[Long]
Counts all the documents in the collection.
Counts all the documents in the collection.
- Doc
the type of the collection
- collection
the abstraction to work with the determined mongodb collection
- retryStrategy
defines the amount of retries and backoff delays for failed requests.
- returns
a Task with a long indicating the number of documents the result will be -1 if the underlying publisher did not emitted any documents, or a failed one when emitted an error.
- Definition Classes
- MongoSource → MongoSourceImpl
- def countAll[Doc](collection: MongoCollection[Doc]): Task[Long]
Counts all the documents in the collection.
Counts all the documents in the collection.
- Doc
the type of the collection
- collection
the abstraction to work with the determined mongodb collection
- returns
a Task with a long indicating the number of documents the result will be -1 if the underlying publisher did not emitted any documents, or a failed one when emitted an error.
- Definition Classes
- MongoSource → MongoSourceImpl
- def distinct[Doc](collection: MongoCollection[Doc], fieldName: String, filter: Bson)(implicit m: Manifest[Doc]): Observable[Doc]
Gets the distinct values of the specified field name.
Gets the distinct values of the specified field name.
- Doc
the type of the collection
- collection
the abstraction to work with the determined mongodb collection
- fieldName
the document's field name
- filter
a document describing the query filter
- m
implicit manifest of type Doc
- returns
an Observable that emits the distinct the distinct values of type Doc
- Definition Classes
- MongoSource → MongoSourceImpl
- See also
com.mongodb.client.model.Filters
- def distinct[Doc, T](collection: MongoCollection[Doc], fieldName: String, clazz: Class[T]): Observable[T]
Gets the distinct values of the specified field name.
Gets the distinct values of the specified field name.
- Doc
the type of the collection
- T
the type of the field which the distinct operation is pointing to
- collection
the abstraction to work with a determined mongodb collection
- fieldName
the document's field name
- clazz
the class to decode each document into
- returns
an Observable that emits the distinct the distinct values of type Doc
- Definition Classes
- MongoSource → MongoSourceImpl
- 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])
- def find[Doc](collection: MongoCollection[Doc], filter: Bson): Observable[Doc]
Finds the documents in the collection that matched the query filter.
Finds the documents in the collection that matched the query filter.
- Doc
the type of the collection
- collection
the abstraction to work with a determined mongodb collection
- filter
a document describing the query filter.
- returns
the documents that matched with the given filter
- Definition Classes
- MongoSource → MongoSourceImpl
- See also
com.mongodb.client.model.Filters
- def findAll[Doc](collection: MongoCollection[Doc]): Observable[Doc]
Finds all documents in the collection.
Finds all documents in the collection.
- Doc
the type of the collection
- collection
the abstraction to work with a determined mongodb collection
- returns
all documents of type Doc within the collection
- Definition Classes
- MongoSource → MongoSourceImpl
- def findOne[Doc](collection: MongoCollection[Doc], filter: Bson): Task[Option[Doc]]
Finds the first encountered document in the collection that matched the query filter if exists, or the empty option if does not.
Finds the first encountered document in the collection that matched the query filter if exists, or the empty option if does not.
- Doc
the type of the collection
- collection
the abstraction to work with a determined mongodb collection
- filter
a document describing the query filter.
- returns
the optional document that matched with the given filter
- Definition Classes
- MongoSource → MongoSourceImpl
- See also
com.mongodb.client.model.Filters
- def findOneAndDelete[Doc](collection: MongoCollection[Doc], filter: Bson, findOneAndDeleteOptions: FindOneAndDeleteOptions = DefaultFindOneAndDeleteOptions, retryStrategy: RetryStrategy = DefaultRetryStrategy): Task[Option[Doc]]
Atomically find a document and remove it.
Atomically find a document and remove it.
- Doc
the type of the collection
- collection
the abstraction to work with the determined mongodb collection
- filter
the query filter to find the document with
- findOneAndDeleteOptions
the options to apply to the operation
- retryStrategy
defines the amount of retries and backoff delays for failed requests.
- returns
a Task containing an optional of the document type that was removed if no documents matched the query filter it returns an empty option.
- Definition Classes
- MongoSource → MongoSourceImpl
- See also
com.mongodb.client.model.Filters
- def findOneAndDelete[Doc](collection: MongoCollection[Doc], filter: Bson): Task[Option[Doc]]
Atomically find a document and remove it.
Atomically find a document and remove it.
- Doc
the type of the collection
- collection
the abstraction to work with the determined mongodb collection
- filter
the query filter to find the document with
- returns
a Task containing an optional of the document type that was removed if no documents matched the query filter it returns an empty option.
- Definition Classes
- MongoSource → MongoSourceImpl
- See also
com.mongodb.client.model.Filters
- def findOneAndReplace[Doc](collection: MongoCollection[Doc], filter: Bson, replacement: Doc, findOneAndReplaceOptions: FindOneAndReplaceOptions = DefaultFindOneAndReplaceOptions, retryStrategy: RetryStrategy = DefaultRetryStrategy): Task[Option[Doc]]
Atomically find a document and replace it.
Atomically find a document and replace it.
- Doc
the type of the collection
- collection
the abstraction to work with the determined mongodb collection
- filter
the query filter to find the document with
- replacement
the replacement document
- findOneAndReplaceOptions
the options to apply to the operation
- retryStrategy
defines the amount of retries and backoff delays for failed requests.
- returns
a Task with an optional of the document document that was replaced. If no documents matched the query filter, then an empty option will be returned.
- Definition Classes
- MongoSource → MongoSourceImpl
- See also
com.mongodb.client.model.Filters
- def findOneAndReplace[Doc](collection: MongoCollection[Doc], filter: Bson, replacement: Doc): Task[Option[Doc]]
Atomically find a document and replace it.
Atomically find a document and replace it.
- Doc
the type of the collection
- collection
the abstraction to work with the determined mongodb collection
- filter
the query filter to find the document with
- replacement
the replacement document
- returns
a Task with an optional of the document that was replaced. If no documents matched the query filter, then an empty option will be returned.
- Definition Classes
- MongoSource → MongoSourceImpl
- See also
com.mongodb.client.model.Filters
- def findOneAndUpdate[Doc](collection: MongoCollection[Doc], filter: Bson, update: Bson, findOneAndUpdateOptions: FindOneAndUpdateOptions = DefaultFindOneAndUpdateOptions, retryStrategy: RetryStrategy = DefaultRetryStrategy): Task[Option[Doc]]
Atomically find a document and update it.
Atomically find a document and update it.
- Doc
the type of the collection
- collection
the abstraction to work with the determined mongodb collection
- filter
the query filter to find the document with
- update
a document describing the update, which may not be null. The update to apply must include only update operators
- findOneAndUpdateOptions
the options to apply to the operation
- retryStrategy
defines the amount of retries and backoff delays for failed requests.
- returns
a Task with an optional of the document that was updated before the update was applied, if no documents matched the query filter, then an empty option will be returned.
- Definition Classes
- MongoSource → MongoSourceImpl
- See also
com.mongodb.client.model.Filters
- def findOneAndUpdate[Doc](collection: MongoCollection[Doc], filter: Bson, update: Bson): Task[Option[Doc]]
Atomically find a document and update it.
Atomically find a document and update it.
- Doc
the type of the collection
- collection
the abstraction to work with the determined mongodb collection
- filter
the query filter to find the document with
- update
a document describing the update, which may not be null. The update to apply must include only update operators
- returns
a Task with an optional of the document that was updated before the update was applied, if no documents matched the query filter, then an empty option will be returned.
- Definition Classes
- MongoSource → MongoSourceImpl
- See also
com.mongodb.client.model.Filters
- 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()