net.fehmicansaglam.tepkin.protocol.command

FindAndModify

Related Doc: package command

case class FindAndModify(databaseName: String, collectionName: String, query: Option[BsonDocument] = None, sort: Option[BsonDocument] = None, removeOrUpdate: Either[Boolean, BsonDocument], returnNew: Boolean = false, fields: Option[Seq[String]] = None, upsert: Boolean = false) extends Command with Product with Serializable

The findAndModify command modifies and returns a single document. By default, the returned document does not include the modifications made on the update. To return the document with the modifications made on the update, use the new option.

collectionName

The collection against which to run the command.

query

Optional. The selection criteria for the modification. Although the query may match multiple documents, findAndModify will only select one document to modify.

sort

Optional. Determines which document the operation modifies if the query selects multiple documents. findAndModify modifies the first document in the sort order specified by this argument.

removeOrUpdate

Must specify either the remove or the update field. Remove removes the document specified in the query field. Set this to true to remove the selected document. The default is false. Update performs an update of the selected document. The update field employs the same update operators or field: value specifications to modify the selected document.

returnNew

Optional. When true, returns the modified document rather than the original. The findAndModify method ignores the new option for remove operations. The default is false.

fields

Optional. A subset of fields to return. The fields document specifies an inclusion of a field with 1.

upsert

Optional. Used in conjunction with the update field. When true, findAndModify creates a new document if no document matches the query, or if documents match the query, findAndModify performs an update. To avoid multiple upserts, ensure that the query fields are uniquely indexed. The default is false.

Linear Supertypes
Serializable, Serializable, Product, Equals, Command, Message, Writable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. FindAndModify
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. Command
  7. Message
  8. Writable
  9. AnyRef
  10. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new FindAndModify(databaseName: String, collectionName: String, query: Option[BsonDocument] = None, sort: Option[BsonDocument] = None, removeOrUpdate: Either[Boolean, BsonDocument], returnNew: Boolean = false, fields: Option[Seq[String]] = None, upsert: Boolean = false)

    collectionName

    The collection against which to run the command.

    query

    Optional. The selection criteria for the modification. Although the query may match multiple documents, findAndModify will only select one document to modify.

    sort

    Optional. Determines which document the operation modifies if the query selects multiple documents. findAndModify modifies the first document in the sort order specified by this argument.

    removeOrUpdate

    Must specify either the remove or the update field. Remove removes the document specified in the query field. Set this to true to remove the selected document. The default is false. Update performs an update of the selected document. The update field employs the same update operators or field: value specifications to modify the selected document.

    returnNew

    Optional. When true, returns the modified document rather than the original. The findAndModify method ignores the new option for remove operations. The default is false.

    fields

    Optional. A subset of fields to return. The fields document specifies an inclusion of a field with 1.

    upsert

    Optional. Used in conjunction with the update field. When true, findAndModify creates a new document if no document matches the query, or if documents match the query, findAndModify performs an update. To avoid multiple upserts, ensure that the query fields are uniquely indexed. The default is false.

Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  5. implicit val byteOrder: ByteOrder

    Definition Classes
    Message
  6. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. val collectionName: String

    The collection against which to run the command.

  8. val command: BsonDocument

    Definition Classes
    FindAndModifyCommand
  9. val databaseName: String

    Definition Classes
    FindAndModifyCommand
  10. def encode: ByteString

    Definition Classes
    Message → Writable
  11. def encodeBody: ByteString

    Definition Classes
    CommandMessage
  12. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  13. val fields: Option[Seq[String]]

    Optional.

    Optional. A subset of fields to return. The fields document specifies an inclusion of a field with 1.

  14. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  16. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  17. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  18. final def notify(): Unit

    Definition Classes
    AnyRef
  19. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  20. val opCode: Int

    Definition Classes
    CommandMessage
  21. def putCString(builder: ByteStringBuilder, value: String): ByteStringBuilder

    Definition Classes
    Writable
  22. val query: Option[BsonDocument]

    Optional.

    Optional. The selection criteria for the modification. Although the query may match multiple documents, findAndModify will only select one document to modify.

  23. val removeOrUpdate: Either[Boolean, BsonDocument]

    Must specify either the remove or the update field.

    Must specify either the remove or the update field. Remove removes the document specified in the query field. Set this to true to remove the selected document. The default is false. Update performs an update of the selected document. The update field employs the same update operators or field: value specifications to modify the selected document.

  24. val requestID: Int

    Definition Classes
    Message
  25. val responseTo: Int

    Definition Classes
    CommandMessage
  26. val returnNew: Boolean

    Optional.

    Optional. When true, returns the modified document rather than the original. The findAndModify method ignores the new option for remove operations. The default is false.

  27. val sort: Option[BsonDocument]

    Optional.

    Optional. Determines which document the operation modifies if the query selects multiple documents. findAndModify modifies the first document in the sort order specified by this argument.

  28. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  29. val upsert: Boolean

    Optional.

    Optional. Used in conjunction with the update field. When true, findAndModify creates a new document if no document matches the query, or if documents match the query, findAndModify performs an update. To avoid multiple upserts, ensure that the query fields are uniquely indexed. The default is false.

  30. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from Command

Inherited from Message

Inherited from Writable

Inherited from AnyRef

Inherited from Any

Ungrouped