Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Timestamp

Hierarchy

Index

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 | Long | Timestamp) => Long

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

    • 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: (divisor: string | number | Long | Timestamp) => Long

Type declaration

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

Type declaration

    • 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: (other: string | number | Long | Timestamp) => boolean

Type declaration

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

Type declaration

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

      Parameters

      Returns boolean

eqz: () => boolean

Type declaration

    • (): boolean
ge: (other: string | number | Long | Timestamp) => 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 | Long | Timestamp) => boolean

Type declaration

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

      Parameters

      Returns boolean

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

Type declaration

    • Tests if this Long's value is greater than or equal the specified's.

      Parameters

      Returns boolean

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

Type declaration

gte: (other: string | number | Long | Timestamp) => 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 | Long | Timestamp) => boolean

Type declaration

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

Type declaration

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

      Parameters

      Returns boolean

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

Type declaration

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

      Parameters

      Returns boolean

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

Type declaration

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

      Parameters

      Returns boolean

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

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

Type declaration

    • Returns the product of this and the specified Long.

      Parameters

      Returns Long

      Product

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

Type declaration

neg: () => Long

Type declaration

negate: () => Long

Type declaration

    • Returns the Negation of this Long's value.

      Returns Long

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

Type declaration

not: () => Long

Type declaration

    • Returns the bitwise NOT of this Long.

      Returns Long

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

Type declaration

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

      Parameters

      Returns boolean

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

Type declaration

    • Returns the bitwise OR of this Long and the specified.

      Parameters

      • other: string | number | Long

      Returns Long

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

Type declaration

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

Type declaration

    • 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

    • 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

    • 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 | Long | Timestamp) => Long

Type declaration

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

Type declaration

    • Returns the difference of this and the specified Long.

      Parameters

      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?: 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: () => 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

    • Converts this Long to signed.

      Returns Long

toString: (radix?: number) => string

Type declaration

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

Type declaration

    • Converts this Long to unsigned.

      Returns Long

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

Type declaration

    • 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

  • inspect(): string
  • Returns string

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

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

  • 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

  • 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