Class Timestamp

Hierarchy (view full)

Constructors

  • Parameters

    • int: bigint

      A 64-bit bigint representing the Timestamp.

    Returns Timestamp

  • Parameters

    • long: Long

      A 64-bit Long representing the Timestamp.

    Returns Timestamp

  • Parameters

    • value: {
          i: number;
          t: number;
      }

      A pair of two values indicating timestamp and increment.

      • i: number
      • t: number

    Returns Timestamp

Properties

__isLong__: boolean
add: ((addend:
    | string
    | number
    | Timestamp
    | Long) => Long)

Type declaration

    • (addend): Long
    • Returns the sum of this and the specified Long.

      Parameters

      • addend:
            | string
            | number
            | Timestamp
            | Long

      Returns Long

and: ((other:
    | string
    | number
    | Timestamp
    | Long) => Long)

Type declaration

    • (other): Long
    • Returns the sum of this and the specified Long.

      Parameters

      • other:
            | string
            | number
            | Timestamp
            | Long

      Returns Long

      Sum

comp: ((other:
    | string
    | number
    | Timestamp
    | Long) => -1 | 0 | 1)

Type declaration

    • (other): -1 | 0 | 1
    • This is an alias of Long.compare

      Parameters

      • other:
            | string
            | number
            | Timestamp
            | Long

      Returns -1 | 0 | 1

compare: ((other:
    | string
    | number
    | Timestamp
    | Long) => -1 | 0 | 1)

Type declaration

    • (other): -1 | 0 | 1
    • Compares this Long's value with the specified's.

      Parameters

      • other:
            | string
            | number
            | Timestamp
            | Long

      Returns -1 | 0 | 1

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

div: ((divisor:
    | string
    | number
    | Timestamp
    | Long) => Long)

Type declaration

divide: ((divisor:
    | string
    | number
    | Timestamp
    | Long) => Long)

Type declaration

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

      Parameters

      • divisor:
            | string
            | number
            | Timestamp
            | Long

      Returns Long

      Quotient

eq: ((other:
    | string
    | number
    | Timestamp
    | Long) => boolean)

Type declaration

    • (other): boolean
    • This is an alias of Long.equals

      Parameters

      • other:
            | string
            | number
            | Timestamp
            | Long

      Returns boolean

equals: ((other:
    | string
    | number
    | Timestamp
    | Long) => boolean)

Type declaration

    • (other): boolean
    • Tests if this Long's value equals the specified's.

      Parameters

      • other:
            | string
            | number
            | Timestamp
            | Long

        Other value

      Returns boolean

eqz: (() => boolean)

Type declaration

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

      Returns boolean

ge: ((other:
    | string
    | number
    | Timestamp
    | Long) => boolean)

Type declaration

getHighBits: (() => number)

Type declaration

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

      Returns number

getHighBitsUnsigned: (() => number)

Type declaration

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

      Returns number

getLowBits: (() => number)

Type declaration

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

      Returns number

getLowBitsUnsigned: (() => number)

Type declaration

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

      Returns number

getNumBitsAbs: (() => number)

Type declaration

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

      Returns number

greaterThan: ((other:
    | string
    | number
    | Timestamp
    | Long) => boolean)

Type declaration

    • (other): boolean
    • Tests if this Long's value is greater than the specified's.

      Parameters

      • other:
            | string
            | number
            | Timestamp
            | Long

      Returns boolean

greaterThanOrEqual: ((other:
    | string
    | number
    | Timestamp
    | Long) => boolean)

Type declaration

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

      Parameters

      • other:
            | string
            | number
            | Timestamp
            | Long

      Returns boolean

gt: ((other:
    | string
    | number
    | Timestamp
    | Long) => boolean)

Type declaration

    • (other): boolean
    • This is an alias of Long.greaterThan

      Parameters

      • other:
            | string
            | number
            | Timestamp
            | Long

      Returns boolean

gte: ((other:
    | string
    | number
    | Timestamp
    | Long) => boolean)

Type declaration

high: number
isEven: (() => boolean)

Type declaration

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

      Returns boolean

isNegative: (() => boolean)

Type declaration

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

      Returns boolean

isOdd: (() => boolean)

Type declaration

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

      Returns boolean

isPositive: (() => boolean)

Type declaration

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

      Returns boolean

isZero: (() => boolean)

Type declaration

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

      Returns boolean

le: ((other:
    | string
    | number
    | Timestamp
    | Long) => boolean)

Type declaration

lessThan: ((other:
    | string
    | number
    | Timestamp
    | Long) => boolean)

Type declaration

    • (other): boolean
    • Tests if this Long's value is less than the specified's.

      Parameters

      • other:
            | string
            | number
            | Timestamp
            | Long

      Returns boolean

lessThanOrEqual: ((other:
    | string
    | number
    | Timestamp
    | Long) => boolean)

Type declaration

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

      Parameters

      • other:
            | string
            | number
            | Timestamp
            | Long

      Returns boolean

low: number
lt: ((other:
    | string
    | number
    | Timestamp
    | Long) => boolean)

Type declaration

    • (other): boolean
    • This is an alias of Long#lessThan.

      Parameters

      • other:
            | string
            | number
            | Timestamp
            | Long

      Returns boolean

lte: ((other:
    | string
    | number
    | Timestamp
    | Long) => boolean)

Type declaration

mod: ((divisor:
    | string
    | number
    | Timestamp
    | Long) => Long)

Type declaration

modulo: ((divisor:
    | string
    | number
    | Timestamp
    | Long) => Long)

Type declaration

    • (divisor): Long
    • Returns this Long modulo the specified.

      Parameters

      • divisor:
            | string
            | number
            | Timestamp
            | Long

      Returns Long

mul: ((multiplier:
    | string
    | number
    | Timestamp
    | Long) => Long)

Type declaration

multiply: ((multiplier:
    | string
    | number
    | Timestamp
    | Long) => Long)

Type declaration

    • (multiplier): Long
    • Returns the product of this and the specified Long.

      Parameters

      • multiplier:
            | string
            | number
            | Timestamp
            | Long

        Multiplier

      Returns Long

      Product

ne: ((other:
    | string
    | number
    | Timestamp
    | Long) => boolean)

Type declaration

    • (other): boolean
    • This is an alias of Long.notEquals

      Parameters

      • other:
            | string
            | number
            | Timestamp
            | Long

      Returns boolean

neg: (() => Long)

Type declaration

negate: (() => Long)

Type declaration

    • (): Long
    • Returns the Negation of this Long's value.

      Returns Long

neq: ((other:
    | string
    | number
    | Timestamp
    | Long) => boolean)

Type declaration

    • (other): boolean
    • This is an alias of Long.notEquals

      Parameters

      • other:
            | string
            | number
            | Timestamp
            | Long

      Returns boolean

not: (() => Long)

Type declaration

    • (): Long
    • Returns the bitwise NOT of this Long.

      Returns Long

notEquals: ((other:
    | string
    | number
    | Timestamp
    | Long) => boolean)

Type declaration

    • (other): boolean
    • Tests if this Long's value differs from the specified's.

      Parameters

      • other:
            | string
            | number
            | Timestamp
            | Long

      Returns boolean

or: ((other: string | number | Long) => Long)

Type declaration

    • (other): Long
    • Returns the bitwise OR of this Long and the specified.

      Parameters

      • other: string | number | Long

      Returns Long

rem: ((divisor:
    | string
    | number
    | Timestamp
    | Long) => Long)

Type declaration

shiftLeft: ((numBits: number | Long) => Long)

Type declaration

    • (numBits): 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: ((numBits: number | Long) => Long)

Type declaration

    • (numBits): 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: ((numBits: number | Long) => Long)

Type declaration

    • (numBits): 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: ((numBits: number | Long) => Long)

Type declaration

shr: ((numBits: number | Long) => Long)

Type declaration

shr_u: ((numBits: number | Long) => Long)

Type declaration

shru: ((numBits: number | Long) => Long)

Type declaration

sub: ((subtrahend:
    | string
    | number
    | Timestamp
    | Long) => Long)

Type declaration

subtract: ((subtrahend:
    | string
    | number
    | Timestamp
    | Long) => Long)

Type declaration

    • (subtrahend): Long
    • Returns the difference of this and the specified Long.

      Parameters

      • subtrahend:
            | string
            | number
            | Timestamp
            | Long

        Subtrahend

      Returns Long

      Difference

toBigInt: (() => bigint)

Type declaration

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

      Returns bigint

toBytes: ((le?: boolean) => number[])

Type declaration

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

      Parameters

      • Optionalle: boolean

        Whether little or big endian, defaults to big endian

      Returns number[]

      Byte representation

toBytesBE: (() => number[])

Type declaration

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

      Returns number[]

      Big endian byte representation

toBytesLE: (() => number[])

Type declaration

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

      Returns number[]

      Little endian byte representation

toInt: (() => number)

Type declaration

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

      Returns number

toNumber: (() => number)

Type declaration

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

      Returns number

toSigned: (() => Long)

Type declaration

    • (): Long
    • Converts this Long to signed.

      Returns Long

toString: ((radix?: number) => string)

Type declaration

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

      Parameters

      • Optionalradix: number

        Radix (2-36), defaults to 10

      Returns string

      RangeError If radix is out of range

toUnsigned: (() => Long)

Type declaration

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

      Returns Long

unsigned: boolean
xor: ((other: string | number | Long) => Long)

Type declaration

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

      Parameters

      • other: string | number | Long

      Returns Long

MAX_VALUE: Long

Accessors

  • get _bsontype(): "Timestamp"
  • Returns "Timestamp"

Methods

  • Parameters

    • Optionaldepth: number
    • Optionaloptions: unknown
    • Optionalinspect: InspectFn

    Returns string

  • Returns {
        $timestamp: string;
    }

    • $timestamp: string
  • 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

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

    Parameters

    • value: number

    Returns Timestamp

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

    Parameters

    • value: number

    Returns 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