Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Timestamp

Hierarchy继承层级

  • LongWithoutOverridesClass
    • Timestamp

Index索引

Constructors构造函数

  • 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

      the low (signed) 32 bits of the Timestamp.

    • high: number

      the high (signed) 32 bits of the Timestamp.

    Returns 返回 Timestamp

Properties属性

__isLong__: true
_bsontype: "Timestamp"
add: (addend: string | number | Long | Timestamp) => Long

Type declaration类型声明

    • Returns the sum of this and the specified Long.返回此值与指定的Long值之和。

      Parameters参数

      Returns 返回 Long

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

Type declaration类型声明

    • Returns the sum of this and the specified Long.返回此值与指定的Long值之和。

      Parameters参数

      Returns 返回 Long

      Sum

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.将此Long的值与指定的值进行比较。

      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如果相同,则为0;如果大于1,则为1;如果给定值大于-1,则为-1

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. 返回此Long除以指定的值。The result is signed if this Long is signed or unsigned if this Long is unsigned.如果此Long为有符号,则结果为有符号;如果此Log为无符号,则为无符号。

      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.测试此Long的值是否等于指定的值。

      Parameters参数

      Returns 返回 boolean

eqz: () => boolean

Type declaration类型声明

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

Type declaration类型声明

getHighBits: () => number

Type declaration类型声明

    • (): number
    • Gets the high 32 bits as a signed integer.获取高位32位作为有符号整数。

      Returns 返回 number

getHighBitsUnsigned: () => number

Type declaration类型声明

    • (): number
    • Gets the high 32 bits as an unsigned integer.获取高位32位作为无符号整数。

      Returns 返回 number

getLowBits: () => number

Type declaration类型声明

    • (): number
    • Gets the low 32 bits as a signed integer.获取低32位作为有符号整数。

      Returns 返回 number

getLowBitsUnsigned: () => number

Type declaration类型声明

    • (): number
    • Gets the low 32 bits as an unsigned integer.获取低32位作为无符号整数。

      Returns 返回 number

getNumBitsAbs: () => number

Type declaration类型声明

    • (): number
    • Gets the number of bits needed to represent the absolute value of this Long.获取表示此Long的绝对值所需的位数。

      Returns 返回 number

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

Type declaration类型声明

    • Tests if this Long's value is greater than the specified's.测试此Long的值是否大于指定值。

      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.测试此Long值是否大于或等于指定值。

      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.测试此Long的值是否为偶数。

      Returns 返回 boolean

isNegative: () => boolean

Type declaration类型声明

    • (): boolean
    • Tests if this Long's value is negative.测试此Long的值是否为负值。

      Returns 返回 boolean

isOdd: () => boolean

Type declaration类型声明

    • (): boolean
    • Tests if this Long's value is odd.测试此Long的值是否为奇数。

      Returns 返回 boolean

isPositive: () => boolean

Type declaration类型声明

    • (): boolean
    • Tests if this Long's value is positive.测试此Long的值是否为正。

      Returns 返回 boolean

isZero: () => boolean

Type declaration类型声明

    • (): boolean
    • Tests if this Long's value equals zero.测试此Long的值是否等于零。

      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.测试此Long的值是否小于指定值。

      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.测试此Long值是否小于或等于指定值。

      Parameters参数

      Returns 返回 boolean

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

Type declaration类型声明

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类型声明

    • Returns this Long modulo the specified.返回指定的长模。

      Parameters参数

      Returns 返回 Long

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.返回此值与指定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.返回此Long值的否定值。

      Returns 返回 Long

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

Type declaration类型声明

not: () => Long

Type declaration类型声明

    • Returns the bitwise NOT of this Long.返回此Long的按位NOT。

      Returns 返回 Long

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

Type declaration类型声明

    • Tests if this Long's value differs from the specified's.测试此Long的值是否与指定值不同。

      Parameters参数

      Returns 返回 boolean

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

Type declaration类型声明

    • Returns the bitwise OR of this Long and the specified.返回此Long与指定值的按位OR。

      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.返回此Long,其中位向左移动给定量。

      Parameters参数

      • numBits: number | Long

        Number of bits位数

      Returns 返回 Long

      Shifted Long移位后的Long

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

Type declaration类型声明

    • Returns this Long with bits arithmetically shifted to the right by the given amount.返回此Long,并将位算术右移给定量。

      Parameters参数

      • numBits: number | Long

        Number of bits位数

      Returns 返回 Long

      Shifted Long移位后的Long

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

Type declaration类型声明

    • Returns this Long with bits logically shifted to the right by the given amount.返回此Long,其中位逻辑右移给定量。

      Parameters参数

      • numBits: number | Long

        Number of bits位数

      Returns 返回 Long

      Shifted Long移位后的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.返回此值与指定的Long值之差。

      Parameters参数

      Returns 返回 Long

      Difference

toBigInt: () => bigint

Type declaration类型声明

    • (): bigint
    • Converts the Long to a BigInt (arbitrary precision).将Long转换为BigInt(任意精度)。

      Returns 返回 bigint

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

Type declaration类型声明

    • (le?: boolean): number[]
    • Converts this Long to its byte representation.将此Long转换为其字节表示形式。

      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.将此Long转换为其大端字节表示形式。

      Returns 返回 number[]

      Big endian byte representation大端字节表示

toBytesLE: () => number[]

Type declaration类型声明

    • (): number[]
    • Converts this Long to its little endian byte representation.将此Long转换为其小端字节表示形式。

      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.将Long转换为32位整数,假定它是32位整数。

      Returns 返回 number

toNumber: () => number

Type declaration类型声明

    • (): number
    • Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa).将“长”转换为此值的最近浮点表示形式(双精度,53位尾数)。

      Returns 返回 number

toSigned: () => Long

Type declaration类型声明

    • Converts this Long to signed.将此Long转换为有符号。

      Returns 返回 Long

toString: (radix?: number) => string

Type declaration类型声明

    • (radix?: number): string
    • Converts the Long to a string written in the specified radix.将Long转换为以指定基数写入的字符串。

      throws

      RangeError If radix is out of range如果radix超出范围则抛出RangeError

      Parameters参数

      • Optional radix: number

        Radix (2-36), defaults to 10基数(2-36),默认为10

      Returns 返回 string

toUnsigned: () => Long

Type declaration类型声明

    • Converts this Long to unsigned.将此Long转换为无符号。

      Returns 返回 Long

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

Type declaration类型声明

    • Returns the bitwise XOR of this Long and the given one.返回此Long与给定Long的按位XOR。

      Parameters参数

      • other: string | number | Long

      Returns 返回 Long

MAX_VALUE: Long

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.假设每个都使用32位。

    Parameters参数

    • lowBits: number

      the low 32-bits.低32位。

    • highBits: number

      the high 32-bits.

    Returns 返回 Timestamp

  • Returns a Timestamp represented by the given (32-bit) integer value.返回由给定(32位)整数值表示的时间戳。

    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