object MongoOp
Provides an idiomatic api for performing single operations against MongoDb. It only exposes methods for appending and modifying (delete, insert, replace and update).
- Alphabetic
- By Inheritance
- MongoOp
- 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
- 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 deleteMany[Doc](collection: MongoCollection[Doc], filter: Bson, deleteOptions: DeleteOptions = DefaultDeleteOptions, retries: Int = 0, timeout: Option[FiniteDuration] = Option.empty, delayAfterFailure: Option[FiniteDuration] = Option.empty): Task[Option[DeleteResult]]
Removes all documents from the collection that match the given query filter.
Removes all documents from the collection that match the given query filter. If no documents match, the collection is not modified.
- Doc
the type of the collection
- collection
the abstraction to work with a determined MongoDB Collection
- filter
the query filter to apply the the delete operation
- deleteOptions
the options to apply to the delete operation, it will use default ones in case it is not passed by the user.
- 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, by default no delay is applied.
- returns
a Task with an optional of DeleteResult or a failed one.
- See also
com.mongodb.client.model.Filters
- def deleteMany[Doc](collection: MongoCollection[Doc], filter: Bson): Task[Option[DeleteResult]]
Removes all documents from the collection that match the given query filter.
Removes all documents from the collection that match the given query filter. If no documents match, the collection is not modified.
- Doc
the type of the collection
- collection
the abstraction to work with a determined MongoDB Collection
- filter
the query filter to apply the the delete operation
- returns
a Task with an optional DeleteResult or a failed one.
- def deleteOne[Doc](collection: MongoCollection[Doc], filter: Bson, deleteOptions: DeleteOptions = DefaultDeleteOptions, retries: Int = 0, timeout: Option[FiniteDuration] = Option.empty, delayAfterFailure: Option[FiniteDuration] = Option.empty): Task[Option[DeleteResult]]
Removes at most one document from the collection that matches the given filter with some delete options.
Removes at most one document from the collection that matches the given filter with some delete options. If no documents match, the collection is not modified.
- Doc
the type of the collection
- collection
the abstraction to work with a determined MongoDB Collection
- filter
the query filter to apply the the delete operation
- deleteOptions
the options to apply to the delete operation, it will use default ones in case it is not passed by the user.
- 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, by default no delay is applied.
- returns
a Task with an optional DeleteResult or a failed one.
- See also
com.mongodb.client.model.Filters
- def deleteOne[Doc](collection: MongoCollection[Doc], filter: Bson): Task[Option[DeleteResult]]
Removes at most one document from the collection that matches the given filter.
Removes at most one document from the collection that matches the given filter. If no documents match, the collection is not modified.
- Doc
the type of the collection.
- collection
the abstraction to work with a determined MongoDB Collection.
- filter
the query filter to apply the delete operation.
- returns
a Task with an optional DeleteResult or a failed one with an com.mongodb.MongoException.
- See also
com.mongodb.client.model.Filters
- 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()
- def insertMany[Doc](collection: MongoCollection[Doc], docs: Seq[Doc], insertManyOptions: InsertManyOptions = DefaultInsertManyOptions, retries: Int = 0, timeout: Option[FiniteDuration] = Option.empty, delayAfterFailure: Option[FiniteDuration] = Option.empty): Task[Boolean]
Inserts a batch of documents.
Inserts a batch of documents. If the documents is missing an identifier, the driver should generate one.
- Doc
the type of the collection
- collection
the abstraction to work with the determined mongodb collection
- docs
the documents to insert
- insertManyOptions
the options to apply to the insert 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, by default no delay is applied.
- returns
a boolean Task that indicates whether the operation completed successfully or it failed with or with com.mongodb.DuplicateKeyException or com.mongodb.MongoException
- def insertMany[Doc](collection: MongoCollection[Doc], docs: Seq[Doc]): Task[Boolean]
Inserts a batch of documents.
Inserts a batch of documents. If the documents is missing an identifier, the driver should generate one.
- Doc
the type of the collection
- collection
the abstraction to work with the determined mongodb collection
- returns
a boolean task that indicates whether the operation completed successfully or it failed with or with com.mongodb.DuplicateKeyException or com.mongodb.MongoException
- def insertOne[Doc](collection: MongoCollection[Doc], document: Doc, insertOneOptions: InsertOneOptions = DefaultInsertOneOptions, retries: Int = 0, timeout: Option[FiniteDuration] = Option.empty, delayAfterFailure: Option[FiniteDuration] = Option.empty): Task[Boolean]
Inserts the provided document.
Inserts the provided document. If the document is missing an identifier, the driver should generate one.
- Doc
the type of the collection
- collection
the abstraction to work with the determined mongodb collection
- document
the document to be inserted
- insertOneOptions
the options to apply to the insert 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, by default no delay is applied.
- returns
a boolean task that indicates whether the operation completed successfully or it failed with or with com.mongodb.DuplicateKeyException or com.mongodb.MongoException
- def insertOne[Doc](collection: MongoCollection[Doc], document: Doc): Task[Boolean]
Inserts the provided document.
Inserts the provided document. If the document is missing an identifier, the driver should generate one.
- Doc
the type of the collection
- collection
the abstraction to work with the determined mongodb collection
- document
the document to be inserted
- returns
a boolean task that indicates whether the operation completed successfully or it failed with or with com.mongodb.DuplicateKeyException or com.mongodb.MongoException
- 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()
- def replaceOne[Doc](collection: MongoCollection[Doc], filter: Bson, replacement: Doc, replaceOptions: ReplaceOptions = DefaultReplaceOptions, retries: Int = 0, timeout: Option[FiniteDuration] = Option.empty, delayAfterFailure: Option[FiniteDuration] = Option.empty): Task[Option[UpdateResult]]
Replace a document in the collection according to the specified arguments.
Replace a document in the collection according to the specified arguments.
- Doc
the type of the collection
- collection
the abstraction to work with the determined mongodb collection
- filter
the query filter to apply the the replace operation
- replacement
the replacement document
- replaceOptions
the options to apply to the replace 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, by default no delay is applied.
- returns
a Task with a single UpdateResult, or a failed one.
- See also
com.mongodb.client.model.Filters
- def replaceOne[Doc](collection: MongoCollection[Doc], filter: Bson, replacement: Doc): Task[Option[UpdateResult]]
Replace a document in the collection according to the specified arguments.
Replace a document in the collection according to the specified arguments.
- Doc
the type of the collection
- collection
the abstraction to work with the determined mongodb collection
- filter
the query filter to apply the the replace operation
- replacement
the replacement document
- returns
a Task with an optional single UpdateResult, or a failed one.
- See also
com.mongodb.client.model.Filters
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def updateMany[Doc](collection: MongoCollection[Doc], filter: Bson, update: Bson, updateOptions: UpdateOptions = DefaultUpdateOptions, retries: Int = 0, timeout: Option[FiniteDuration] = Option.empty, delayAfterFailure: Option[FiniteDuration] = Option.empty): Task[Option[UpdateResult]]
Update all documents in the collection according to the specified arguments.
Update all documents in the collection according to the specified arguments.
- Doc
the type of the collection
- collection
the abstraction to work with the determined mongodb Collection.
- filter
a document describing the query filter, which may not be null.
- update
a document describing the update, which may not be null, the update to apply must include only update operators
- updateOptions
the options to apply to the update 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 UpdateResult or a failed one.
- See also
com.mongodb.client.model.Filters
com.mongodb.client.model.Updates
- def updateMany[Doc](collection: MongoCollection[Doc], filter: Bson, update: Bson): Task[Option[UpdateResult]]
Update all documents in the collection according to the specified arguments.
Update all documents in the collection according to the specified arguments.
- Doc
the type of the collection
- collection
the abstraction to work with the determined mongodb Collection.
- filter
a document describing the query filter, which may not be null.
- returns
a Task with an optional UpdateResult or a failed one.
- See also
com.mongodb.client.model.Filters
- def updateOne[Doc](collection: MongoCollection[Doc], filter: Bson, update: Bson, updateOptions: UpdateOptions = DefaultUpdateOptions, retries: Int = 0, timeout: Option[FiniteDuration] = Option.empty, delayAfterFailure: Option[FiniteDuration] = Option.empty): Task[Option[UpdateResult]]
Update a single document in the collection according to the specified arguments.
Update a single document in the collection according to the specified arguments.
- Doc
the type of the collection
- collection
the abstraction to work with the determined mongodb Collection.
- filter
a document describing the query filter, which may not be null.
- update
a document describing the update, which may not be null, the update to apply must include only update operators
- updateOptions
the options to apply to the update 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, by default no delay is applied.
- returns
a Task with an optional UpdateResult or a failed one.
- See also
com.mongodb.client.model.Filters
com.mongodb.client.model.Updates
- def updateOne[Doc](collection: MongoCollection[Doc], filter: Bson, update: Bson): Task[Option[UpdateResult]]
Update a single document in the collection according to the specified arguments.
Update a single document in the collection according to the specified arguments.
- Doc
the type of the collection
- collection
the abstraction to work with the determined mongodb collection
- filter
a document describing the query filter, which may not be null.
- 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 UpdateResult or a failed one.
- See also
com.mongodb.client.model.Filters
com.mongodb.client.model.Updates
- 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()