AbstractCompoundOption¶
abstract class AbstractCompoundOption(
name: String,
content: BsonNode,
context: BsonContext
) : AbstractOption
Utility to easily implement options that contain a document as content.
Inheritors¶
Constructors¶
AbstractCompoundOption¶
constructor(
name: String,
content: BsonNode,
context: BsonContext
)
Properties¶
context¶
@LowLevelApi
open override val context: BsonContext
The context used to generate this expression.
name¶
The name of this option, as it appears in the BSON representation.
Options always have the form:
In this example, the LimitOption has the name "limit" and the SortOption has the name "sort".
Implementation notes
This value should be immutable.
Functions¶
freeze¶
@LowLevelApi
open override fun freeze()
Makes this node immutable.
read¶
@LowLevelApi
override fun read(): BsonValue
Reads the value of this option.
Performance
Note that this method requires to write this option into a temporary BSON value.
simplify¶
@LowLevelApi
override fun simplify(): AbstractBsonNode?
Returns a simplified (but equivalent) expression to the current expression.
Returns null when the current expression was simplified into a no-op (= it does nothing).
toBson¶
@LowLevelApi
open fun toBson(): BsonDocument
Writes the result of simplifying to a new BsonDocument.
toString¶
writeTo¶
@LowLevelApi
override fun writeTo(writer: BsonFieldWriter)
Writes the result of simplifying this expression into writer.