Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Timestamp

Hierarchy层级

  • LongWithoutOverridesClass
    • Timestamp

Index索引

Constructors构造函数

constructor

  • Parameters参数

    Returns返回Timestamp

  • Parameters参数

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

      A pair of two values indicating timestamp and increment.

      • i: number
      • t: number

    Returns返回Timestamp

  • deprecated

    Please use Timestamp({ t: high, i: low }) or Timestamp(Long(low, high)) instead.

    Parameters参数

    • low: number

      A 64-bit Long representing the Timestamp.

    • high: number

      the high (signed) 32 bits of the Timestamp.

    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这是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这是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这是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这是Long.isZero的别名

    Returns返回boolean

ge

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这是Long.greaterThan的别名

    Parameters参数

    Returns返回boolean

gte

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这是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这是Long.lessThanOrEqual的别名

    Parameters参数

    Returns返回boolean

mod

  • This is an alias of Long.modulo这是Long.modulo的别名

    Parameters参数

    Returns返回Long

modulo

  • Returns this Long modulo the specified.

    Parameters参数

    Returns返回Long

mul

  • This is an alias of Long.multiply这是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这是Long.notEquals的别名

    Parameters参数

    Returns返回boolean

neg

  • This is an alias of Long.negate这是Long.negate的别名

    Returns返回Long

negate

  • Returns the Negation of this Long's value.

    Returns返回Long

neq

  • This is an alias of Long.notEquals这是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这是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这是Long.shiftLeft的别名

    Parameters参数

    • numBits: number | Long

    Returns返回Long

shr

  • This is an alias of Long.shiftRight这是Long.shiftRight的别名

    Parameters参数

    • numBits: number | Long

    Returns返回Long

shr_u

shru

sub

  • This is an alias of Long.subtract这是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