object MongoSource
An object exposing those MongoDb signatures that basically aims to fetch data from the collections by performing different type of read queries available such like find, count, distinct or any type of aggregation. There are three exceptions in which the method alters the data apart of fetching it, which are the findOne and delete, replace or update.
- Alphabetic
- By Inheritance
- MongoSource
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
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.
-
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 operation
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
count[Doc](collection: MongoCollection[Doc], filter: Bson, countOptions: CountOptions = DefaultCountOptions, retries: Int = 0, timeout: Option[FiniteDuration] = Option.empty, delayAfterFailure: Option[FiniteDuration] = Option.empty): 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
- retries
the number of times the operation will be retried in case of unexpected failure, being zero retries by default
- timeout
expected timeout that the operation is expected to be executed or else return a failure
- delayAfterFailure
the delay set after the execution of a single operation failed.
- 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.
- 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 can be -1 if the underlying publisher did not emitted any documents, or a failed one when emitted an error.
- See also
com.mongodb.client.model.Filters
-
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 can be -1 if the underlying publisher did not emitted any documents, or a failed one when emitted an error.
-
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
- 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
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): 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.
- 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
-
def
findOneAndDelete[Doc](collection: MongoCollection[Doc], filter: Bson, findOneAndDeleteOptions: FindOneAndDeleteOptions = DefaultFindOneAndDeleteOptions, retries: Int = 0, timeout: Option[FiniteDuration] = Option.empty, delayAfterFailure: Option[FiniteDuration] = Option.empty): 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
- retries
the number of times the operation will be retried in case of unexpected failure, being zero retries by default
- timeout
expected timeout that the operation is expected to be executed or else return a failure
- delayAfterFailure
the delay set after the execution of a single operation failed.
- 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.
- 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.
- See also
com.mongodb.client.model.Filters
-
def
findOneAndReplace[Doc](collection: MongoCollection[Doc], filter: Bson, replacement: Doc, findOneAndReplaceOptions: FindOneAndReplaceOptions = DefaultFindOneAndReplaceOptions, retries: Int = 0, timeout: Option[FiniteDuration] = Option.empty, delayAfterFailure: Option[FiniteDuration] = Option.empty): 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
- retries
the number of times the operation will be retried in case of unexpected failure, being zero retries by default
- timeout
expected timeout that the operation is expected to be executed or else return a failure
- delayAfterFailure
the delay set after the execution of a single operation failed.
- 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.
- 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.
- See also
com.mongodb.client.model.Filters
-
def
findOneAndUpdate[Doc](collection: MongoCollection[Doc], filter: Bson, update: Bson, findOneAndUpdateOptions: FindOneAndUpdateOptions = DefaultFindOneAndUpdateOptions, retries: Int = 0, timeout: Option[FiniteDuration] = Option.empty, delayAfterFailure: Option[FiniteDuration] = Option.empty): 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
- retries
the number of times the operation will be retried in case of unexpected failure, being zero retries by default
- timeout
expected timeout that the operation is expected to be executed or else return a failure
- delayAfterFailure
the delay set after the execution of a single operation failed.
- 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.
- See also
com.mongodb.client.model.Filters
-
final
def
getClass(): Class[_]
- 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( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()