BaseIndex

类: abstract BaseIndex<TKey>

定义于: packages/db/src/indexes/base-index.ts:28

所有索引类型都扩展的抽象基类

继承自

类型参数

TKey 继承自 string | number = string | number

构造函数

new BaseIndex()

ts
new BaseIndex<TKey>(
   id, 
   expression, 
   name?, 
options?): BaseIndex<TKey>
new BaseIndex<TKey>(
   id, 
   expression, 
   name?, 
options?): BaseIndex<TKey>

定义于: packages/db/src/indexes/base-index.ts:40

参数

id

number

expression

BasicExpression

name?

string

options?

any

Returns (返回)

BaseIndex<TKey>

属性

expression

ts
readonly expression: BasicExpression;
readonly expression: BasicExpression;

定义于: packages/db/src/indexes/base-index.ts:33


id

ts
readonly id: number;
readonly id: number;

定义于: packages/db/src/indexes/base-index.ts:31


lastUpdated

ts
protected lastUpdated: Date;
protected lastUpdated: Date;

定义于: packages/db/src/indexes/base-index.ts:38


lookupCount

ts
protected lookupCount: number = 0;
protected lookupCount: number = 0;

定义于: packages/db/src/indexes/base-index.ts:36


name?

ts
readonly optional name: string;
readonly optional name: string;

定义于: packages/db/src/indexes/base-index.ts:32


supportedOperations

ts
abstract readonly supportedOperations: Set<"eq" | "gt" | "gte" | "lt" | "lte" | "in" | "like" | "ilike">;
abstract readonly supportedOperations: Set<"eq" | "gt" | "gte" | "lt" | "lte" | "in" | "like" | "ilike">;

定义于: packages/db/src/indexes/base-index.ts:34


totalLookupTime

ts
protected totalLookupTime: number = 0;
protected totalLookupTime: number = 0;

定义于: packages/db/src/indexes/base-index.ts:37

访问器

keyCount

Get Signature

ts
get abstract keyCount(): number
get abstract keyCount(): number

定义于: packages/db/src/indexes/base-index.ts:59

Returns (返回)

number

方法

add()

ts
abstract add(key, item): void
abstract add(key, item): void

定义于: packages/db/src/indexes/base-index.ts:53

参数

key

TKey

item

any

Returns (返回)

void


build()

ts
abstract build(entries): void
abstract build(entries): void

定义于: packages/db/src/indexes/base-index.ts:56

参数

entries

Iterable<[TKey, any]>

Returns (返回)

void


clear()

ts
abstract clear(): void
abstract clear(): void

定义于: packages/db/src/indexes/base-index.ts:57

Returns (返回)

void


evaluateIndexExpression()

ts
protected evaluateIndexExpression(item): any
protected evaluateIndexExpression(item): any

定义于: packages/db/src/indexes/base-index.ts:87

参数

item

any

Returns (返回)

any


getStats()

ts
getStats(): IndexStats
getStats(): IndexStats

定义于: packages/db/src/indexes/base-index.ts:74

Returns (返回)

IndexStats


initialize()

ts
abstract protected initialize(options?): void
abstract protected initialize(options?): void

定义于: packages/db/src/indexes/base-index.ts:85

参数

options?

any

Returns (返回)

void


lookup()

ts
abstract lookup(operation, value): Set<TKey>
abstract lookup(operation, value): Set<TKey>

定义于: packages/db/src/indexes/base-index.ts:58

参数

operation

"eq" | "gt" | "gte" | "lt" | "lte" | "in" | "like" | "ilike"

value

any

Returns (返回)

Set<TKey>


matchesField()

ts
matchesField(fieldPath): boolean
matchesField(fieldPath): boolean

定义于: packages/db/src/indexes/base-index.ts:66

参数

fieldPath

string[]

Returns (返回)

boolean


remove()

ts
abstract remove(key, item): void
abstract remove(key, item): void

定义于: packages/db/src/indexes/base-index.ts:54

参数

key

TKey

item

any

Returns (返回)

void


supports()

ts
supports(operation): boolean
supports(operation): boolean

定义于: packages/db/src/indexes/base-index.ts:62

参数

operation

"eq" | "gt" | "gte" | "lt" | "lte" | "in" | "like" | "ilike"

Returns (返回)

boolean


trackLookup()

ts
protected trackLookup(startTime): void
protected trackLookup(startTime): void

定义于: packages/db/src/indexes/base-index.ts:92

参数

startTime

number

Returns (返回)

void


update()

ts
abstract update(
   key, 
   oldItem, 
   newItem): void
abstract update(
   key, 
   oldItem, 
   newItem): void

定义于: packages/db/src/indexes/base-index.ts:55

参数

key

TKey

oldItem

any

newItem

any

Returns (返回)

void


updateTimestamp()

ts
protected updateTimestamp(): void
protected updateTimestamp(): void

定义于: packages/db/src/indexes/base-index.ts:98

Returns (返回)

void

我们的合作伙伴
Code Rabbit
Electric
Prisma
订阅 Bytes

您的每周 JavaScript 资讯。每周一免费发送给超过 10 万开发者。

Bytes

无垃圾邮件。您可以随时取消订阅。

订阅 Bytes

您的每周 JavaScript 资讯。每周一免费发送给超过 10 万开发者。

Bytes

无垃圾邮件。您可以随时取消订阅。