BsonTimestamp

class BsonTimestamp(value: Long) : BsonValue, Comparable<BsonTimestamp>

A representation the BSON timestamp type.

Note: BSON has a special timestamp type for internal MongoDB use and is not associated with the regular BsonDateTime. This internal timestamp type is a 64 bit value where:

  • the most significant 32 bits are a time_t value (seconds since the Unix epoch)

  • the least significant 32 bits are an incrementing ordinal for operations within a given second.

Constructors

Link copied to clipboard
fun BsonTimestamp(seconds: Int, increment: Int)

Construct a new instance for the given time and increment.

Link copied to clipboard
fun BsonTimestamp(value: Long = 0)

construct a new instance

Functions

Link copied to clipboard
fun asArray(): BsonArray

Gets this value as a BsonArray if it is one, otherwise throws exception

Link copied to clipboard
fun asBinary(): BsonBinary

Gets this value as a BsonBinary if it is one, otherwise throws exception

Link copied to clipboard
fun asBoolean(): BsonBoolean

Gets this value as a BsonBoolean if it is one, otherwise throws exception

Link copied to clipboard
fun asBsonMaxKey(): BsonMaxKey

Gets this value as a BsonMaxKey if it is one, otherwise throws exception

Link copied to clipboard
fun asBsonMinKey(): BsonMinKey

Gets this value as a BsonMinKey if it is one, otherwise throws exception

Link copied to clipboard
fun asBsonNull(): BsonNull

Gets this value as a BsonNull if it is one, otherwise throws exception

Link copied to clipboard
fun asBsonUndefined(): BsonUndefined

Gets this value as a BsonUndefined if it is one, otherwise throws exception

Link copied to clipboard
fun asDateTime(): BsonDateTime

Gets this value as a BsonDateTime if it is one, otherwise throws exception

Link copied to clipboard
fun asDBPointer(): BsonDBPointer

Gets this value as a BsonDBPointer if it is one, otherwise throws exception

Link copied to clipboard
fun asDecimal128(): BsonDecimal128

Gets this value as a BsonDecimal128 if it is one, otherwise throws exception

Link copied to clipboard
fun asDocument(): BsonDocument

Gets this value as a BsonDocument if it is one, otherwise throws exception

Link copied to clipboard
fun asDouble(): BsonDouble

Gets this value as a BsonDouble if it is one, otherwise throws exception

Link copied to clipboard
fun asInt32(): BsonInt32

Gets this value as a BsonInt32 if it is one, otherwise throws exception

Link copied to clipboard
fun asInt64(): BsonInt64

Gets this value as a BsonInt64 if it is one, otherwise throws exception

Link copied to clipboard
fun asJavaScript(): BsonJavaScript

Gets this value as a BsonJavaScript if it is one, otherwise throws exception

Link copied to clipboard
fun asJavaScriptWithScope(): BsonJavaScriptWithScope

Gets this value as a BsonJavaScriptWithScope if it is one, otherwise throws exception

Link copied to clipboard
fun asNumber(): BsonNumber

Gets this value as a BsonNumber if it is one, otherwise throws exception

Link copied to clipboard
fun asObjectId(): BsonObjectId

Gets this value as an BsonObjectId if it is one, otherwise throws exception

Link copied to clipboard
fun asRegularExpression(): BsonRegularExpression

Gets this value as a BsonRegularExpression if it is one, otherwise throws exception

Link copied to clipboard
fun asString(): BsonString

Gets this value as a BsonString if it is one, otherwise throws exception

Link copied to clipboard
fun asSymbol(): BsonSymbol

Gets this value as a BsonSymbol if it is one, otherwise throws exception

Link copied to clipboard
fun asTimestamp(): BsonTimestamp

Gets this value as a BsonTimestamp if it is one, otherwise throws exception

Link copied to clipboard
open operator override fun compareTo(other: BsonTimestamp): Int
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun isArray(): Boolean
Link copied to clipboard
fun isBinary(): Boolean
Link copied to clipboard
fun isBoolean(): Boolean
Link copied to clipboard
fun isDateTime(): Boolean
Link copied to clipboard
fun isDBPointer(): Boolean
Link copied to clipboard
fun isDecimal128(): Boolean
Link copied to clipboard
fun isDocument(): Boolean
Link copied to clipboard
fun isDouble(): Boolean
Link copied to clipboard
fun isInt32(): Boolean
Link copied to clipboard
fun isInt64(): Boolean
Link copied to clipboard
fun isJavaScript(): Boolean
Link copied to clipboard
fun isJavaScriptWithScope(): Boolean
Link copied to clipboard
fun isMaxKey(): Boolean
Link copied to clipboard
fun isMinKey(): Boolean
Link copied to clipboard
fun isNull(): Boolean
Link copied to clipboard
fun isNumber(): Boolean
Link copied to clipboard
fun isObjectId(): Boolean
Link copied to clipboard
fun isRegularExpression(): Boolean
Link copied to clipboard
fun isString(): Boolean
Link copied to clipboard
fun isSymbol(): Boolean
Link copied to clipboard
fun isTimestamp(): Boolean
Link copied to clipboard
fun isUndefined(): Boolean
Link copied to clipboard
fun toJson(): String

Return an extended json representation of this BsonValue

Link copied to clipboard
open override fun toString(): String

Properties

Link copied to clipboard
open override val bsonType: BsonType

Gets the BSON type of this value.

Link copied to clipboard
val inc: Int

Gets the incrementing ordinal for operations within a given second

Link copied to clipboard
val time: Int

Gets the time in seconds since epoch.

Link copied to clipboard
val value: Long = 0

the timestamp