Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Timestamp

Hierarchy

  • LongWithoutOverridesClass
    • Timestamp

Index

Constructors

constructor

  • Parameters

    • low: Long

      A 64-bit Long representing the Timestamp.

    Returns Timestamp

  • Parameters

    • low: Long

      the low (signed) 32 bits of the Timestamp.

    Returns Timestamp

  • Parameters

    • low: number
    • high: number

    Returns Timestamp

Properties

_bsontype

_bsontype: "Timestamp"

Static Readonly MAX_VALUE

MAX_VALUE: Long

Methods

__isLong__

__isLong__:

add

  • Returns the sum of this and the specified Long.

    Parameters

    Returns Long

and

  • Returns the sum of this and the specified Long.

    Parameters

    Returns Long

    Sum

comp

  • This is an alias of Long.compare

    Parameters

    Returns 0 | 1 | -1

compare

  • Compares this Long's value with the specified's.

    Parameters

    Returns 0 | 1 | -1

    0 if they are the same, 1 if the this is greater and -1 if the given one is greater

div

  • This is an alias of Long.divide

    Parameters

    Returns Long

divide

  • Returns this Long divided by the specified. The result is signed if this Long is signed or unsigned if this Long is unsigned.

    Parameters

    Returns Long

    Quotient

eq

  • This is an alias of Long.equals

    Parameters

    Returns boolean

equals

  • Tests if this Long's value equals the specified's.

    Parameters

    Returns boolean

eqz

  • eqz(): boolean
  • This is an alias of Long.isZero

    Returns boolean

ge

  • This is an alias of Long.greaterThanOrEqual

    Parameters

    Returns boolean

getHighBits

  • getHighBits(): number
  • Gets the high 32 bits as a signed integer.

    Returns number

getHighBitsUnsigned

  • getHighBitsUnsigned(): number
  • Gets the high 32 bits as an unsigned integer.

    Returns number

getLowBits

  • getLowBits(): number
  • Gets the low 32 bits as a signed integer.

    Returns number

getLowBitsUnsigned

  • getLowBitsUnsigned(): number
  • Gets the low 32 bits as an unsigned integer.

    Returns number

getNumBitsAbs

  • getNumBitsAbs(): number
  • Gets the number of bits needed to represent the absolute value of this Long.

    Returns number

greaterThan

  • greaterThan(other: string | number | Long | Timestamp): boolean
  • Tests if this Long's value is greater than the specified's.

    Parameters

    Returns boolean

greaterThanOrEqual

  • greaterThanOrEqual(other: string | number | Long | Timestamp): boolean
  • Tests if this Long's value is greater than or equal the specified's.

    Parameters

    Returns boolean

gt

  • This is an alias of Long.greaterThan

    Parameters

    Returns boolean

gte

  • This is an alias of Long.greaterThanOrEqual

    Parameters

    Returns boolean

high

high:

inspect

  • inspect(): string
  • Returns string

isEven

  • isEven(): boolean
  • Tests if this Long's value is even.

    Returns boolean

isNegative

  • isNegative(): boolean
  • Tests if this Long's value is negative.

    Returns boolean

isOdd

  • isOdd(): boolean
  • Tests if this Long's value is odd.

    Returns boolean

isPositive

  • isPositive(): boolean
  • Tests if this Long's value is positive.

    Returns boolean

isZero

  • isZero(): boolean
  • Tests if this Long's value equals zero.

    Returns boolean

le

  • This is an alias of Long.lessThanOrEqual

    Parameters

    Returns boolean

lessThan

  • Tests if this Long's value is less than the specified's.

    Parameters

    Returns boolean

lessThanOrEqual

  • lessThanOrEqual(other: string | number | Long | Timestamp): boolean
  • Tests if this Long's value is less than or equal the specified's.

    Parameters

    Returns boolean

low

low:

lt

  • This is an alias of {@link Long#lessThan}.

    Parameters

    Returns boolean

lte

  • This is an alias of Long.lessThanOrEqual

    Parameters

    Returns boolean

mod

  • This is an alias of Long.modulo

    Parameters

    Returns Long

modulo

  • Returns this Long modulo the specified.

    Parameters

    Returns Long

mul

  • This is an alias of Long.multiply

    Parameters

    Returns Long

multiply

  • Returns the product of this and the specified Long.

    Parameters

    Returns Long

    Product

ne

  • This is an alias of Long.notEquals

    Parameters

    Returns boolean

neg

  • This is an alias of Long.negate

    Returns Long

negate

  • Returns the Negation of this Long's value.

    Returns Long

neq

  • This is an alias of Long.notEquals

    Parameters

    Returns boolean

not

  • Returns the bitwise NOT of this Long.

    Returns Long

notEquals

  • Tests if this Long's value differs from the specified's.

    Parameters

    Returns boolean

or

  • or(other: string | number | Long): Long
  • Returns the bitwise OR of this Long and the specified.

    Parameters

    • other: string | number | Long

    Returns Long

rem

  • This is an alias of Long.modulo

    Parameters

    Returns Long

shiftLeft

  • shiftLeft(numBits: number | Long): Long
  • Returns this Long with bits shifted to the left by the given amount.

    Parameters

    • numBits: number | Long

      Number of bits

    Returns Long

    Shifted Long

shiftRight

  • shiftRight(numBits: number | Long): Long
  • Returns this Long with bits arithmetically shifted to the right by the given amount.

    Parameters

    • numBits: number | Long

      Number of bits

    Returns Long

    Shifted Long

shiftRightUnsigned

  • shiftRightUnsigned(numBits: number | Long): Long
  • Returns this Long with bits logically shifted to the right by the given amount.

    Parameters

    • numBits: number | Long

      Number of bits

    Returns Long

    Shifted Long

shl

  • This is an alias of Long.shiftLeft

    Parameters

    • numBits: number | Long

    Returns Long

shr

  • This is an alias of Long.shiftRight

    Parameters

    • numBits: number | Long

    Returns Long

shr_u

  • This is an alias of Long.shiftRightUnsigned

    Parameters

    • numBits: number | Long

    Returns Long

shru

  • This is an alias of Long.shiftRightUnsigned

    Parameters

    • numBits: number | Long

    Returns Long

sub

  • This is an alias of Long.subtract

    Parameters

    Returns Long

subtract

  • Returns the difference of this and the specified Long.

    Parameters

    Returns Long

    Difference

toBigInt

  • toBigInt(): bigint
  • Converts the Long to a BigInt (arbitrary precision).

    Returns bigint

toBytes

  • toBytes(le?: boolean): number[]
  • Converts this Long to its byte representation.

    Parameters

    • Optional le: boolean

      Whether little or big endian, defaults to big endian

    Returns number[]

    Byte representation

toBytesBE

  • toBytesBE(): number[]
  • Converts this Long to its big endian byte representation.

    Returns number[]

    Big endian byte representation

toBytesLE

  • toBytesLE(): number[]
  • Converts this Long to its little endian byte representation.

    Returns number[]

    Little endian byte representation

toInt

  • toInt(): number
  • Converts the Long to a 32 bit integer, assuming it is a 32 bit integer.

    Returns number

toJSON

  • toJSON(): { $timestamp: string }
  • Returns { $timestamp: string }

    • $timestamp: string

toNumber

  • toNumber(): number
  • Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa).

    Returns number

toSigned

  • Converts this Long to signed.

    Returns Long

toString

  • toString(radix?: number): string
  • Converts the Long to a string written in the specified radix.

    throws

    RangeError If radix is out of range

    Parameters

    • Optional radix: number

      Radix (2-36), defaults to 10

    Returns string

toUnsigned

  • toUnsigned(): Long
  • Converts this Long to unsigned.

    Returns Long

unsigned

unsigned:

xor

  • xor(other: string | number | Long): Long
  • Returns the bitwise XOR of this Long and the given one.

    Parameters

    • other: string | number | Long

    Returns Long

Static fromBits

  • fromBits(lowBits: number, highBits: number): Timestamp
  • Returns a Timestamp for the given high and low bits. Each is assumed to use 32 bits.

    Parameters

    • lowBits: number

      the low 32-bits.

    • highBits: number

      the high 32-bits.

    Returns Timestamp

Static fromInt

  • Returns a Timestamp represented by the given (32-bit) integer value.

    Parameters

    • value: number

    Returns Timestamp

Static fromNumber

  • Returns a Timestamp representing the given number value, provided that it is a finite number. Otherwise, zero is returned.

    Parameters

    • value: number

    Returns Timestamp

Static fromString

  • fromString(str: string, optRadix: number): Timestamp
  • Returns a Timestamp from the given string, optionally using the given radix.

    Parameters

    • str: string

      the textual representation of the Timestamp.

    • optRadix: number

      the radix in which the text is written.

    Returns Timestamp

Generated using TypeDoc