Saltar al contenido principal

Class: SimpleDocumentStore

Hierarchy

  • KVDocumentStore

    SimpleDocumentStore

Constructors

constructor

new SimpleDocumentStore(kvStore?, namespace?): SimpleDocumentStore

Parameters

NameType
kvStore?SimpleKVStore
namespace?string

Returns

SimpleDocumentStore

Overrides

KVDocumentStore.constructor

Defined in

packages/core/src/storage/docStore/SimpleDocumentStore.ts:18

Properties

kvStore

Private kvStore: SimpleKVStore

Defined in

packages/core/src/storage/docStore/SimpleDocumentStore.ts:16

Methods

addDocuments

addDocuments(docs, allowUpdate?): Promise<void>

Parameters

NameTypeDefault value
docsBaseNode<Metadata>[]undefined
allowUpdatebooleantrue

Returns

Promise<void>

Inherited from

KVDocumentStore.addDocuments

Defined in

packages/core/src/storage/docStore/KVDocumentStore.ts:35


deleteDocument

deleteDocument(docId, raiseError?, removeRefDocNode?): Promise<void>

Parameters

NameTypeDefault value
docIdstringundefined
raiseErrorbooleantrue
removeRefDocNodebooleantrue

Returns

Promise<void>

Inherited from

KVDocumentStore.deleteDocument

Defined in

packages/core/src/storage/docStore/KVDocumentStore.ts:135


deleteRefDoc

deleteRefDoc(refDocId, raiseError?): Promise<void>

Parameters

NameTypeDefault value
refDocIdstringundefined
raiseErrorbooleantrue

Returns

Promise<void>

Inherited from

KVDocumentStore.deleteRefDoc

Defined in

packages/core/src/storage/docStore/KVDocumentStore.ts:152


docs

docs(): Promise<Record<string, BaseNode<Metadata>>>

Returns

Promise<Record<string, BaseNode<Metadata>>>

Inherited from

KVDocumentStore.docs

Defined in

packages/core/src/storage/docStore/KVDocumentStore.ts:26


documentExists

documentExists(docId): Promise<boolean>

Parameters

NameType
docIdstring

Returns

Promise<boolean>

Inherited from

KVDocumentStore.documentExists

Defined in

packages/core/src/storage/docStore/KVDocumentStore.ts:109


getAllDocumentHashes

getAllDocumentHashes(): Promise<Record<string, string>>

Returns

Promise<Record<string, string>>

Inherited from

KVDocumentStore.getAllDocumentHashes

Defined in

packages/core/src/storage/docStore/KVDocumentStore.ts:183


getAllRefDocInfo

getAllRefDocInfo(): Promise<undefined | Record<string, RefDocInfo>>

Returns

Promise<undefined | Record<string, RefDocInfo>>

Inherited from

KVDocumentStore.getAllRefDocInfo

Defined in

packages/core/src/storage/docStore/KVDocumentStore.ts:97


getDocument

getDocument(docId, raiseError?): Promise<undefined | BaseNode<Metadata>>

Parameters

NameTypeDefault value
docIdstringundefined
raiseErrorbooleantrue

Returns

Promise<undefined | BaseNode<Metadata>>

Inherited from

KVDocumentStore.getDocument

Defined in

packages/core/src/storage/docStore/KVDocumentStore.ts:77


getDocumentHash

getDocumentHash(docId): Promise<undefined | string>

Parameters

NameType
docIdstring

Returns

Promise<undefined | string>

Inherited from

KVDocumentStore.getDocumentHash

Defined in

packages/core/src/storage/docStore/KVDocumentStore.ts:178


getNode

getNode(nodeId, raiseError?): Promise<BaseNode<Metadata>>

Parameters

NameTypeDefault value
nodeIdstringundefined
raiseErrorbooleantrue

Returns

Promise<BaseNode<Metadata>>

Inherited from

KVDocumentStore.getNode

Defined in

packages/core/src/storage/docStore/types.ts:59


getNodeDict

getNodeDict(nodeIdDict): Promise<Record<number, BaseNode<Metadata>>>

Parameters

NameType
nodeIdDictObject

Returns

Promise<Record<number, BaseNode<Metadata>>>

Inherited from

KVDocumentStore.getNodeDict

Defined in

packages/core/src/storage/docStore/types.ts:67


getNodes

getNodes(nodeIds, raiseError?): Promise<BaseNode<Metadata>[]>

Parameters

NameTypeDefault value
nodeIdsstring[]undefined
raiseErrorbooleantrue

Returns

Promise<BaseNode<Metadata>[]>

Inherited from

KVDocumentStore.getNodes

Defined in

packages/core/src/storage/docStore/types.ts:53


getRefDocInfo

getRefDocInfo(refDocId): Promise<undefined | RefDocInfo>

Parameters

NameType
refDocIdstring

Returns

Promise<undefined | RefDocInfo>

Inherited from

KVDocumentStore.getRefDocInfo

Defined in

packages/core/src/storage/docStore/KVDocumentStore.ts:92


persist

persist(persistPath?, fs?): Promise<void>

Parameters

NameType
persistPathstring
fs?GenericFileSystem

Returns

Promise<void>

Overrides

KVDocumentStore.persist

Defined in

packages/core/src/storage/docStore/SimpleDocumentStore.ts:51


refDocExists

refDocExists(refDocId): Promise<boolean>

Parameters

NameType
refDocIdstring

Returns

Promise<boolean>

Inherited from

KVDocumentStore.refDocExists

Defined in

packages/core/src/storage/docStore/KVDocumentStore.ts:105


setDocumentHash

setDocumentHash(docId, docHash): Promise<void>

Parameters

NameType
docIdstring
docHashstring

Returns

Promise<void>

Inherited from

KVDocumentStore.setDocumentHash

Defined in

packages/core/src/storage/docStore/KVDocumentStore.ts:173


toDict

toDict(): SaveDict

Returns

SaveDict

Defined in

packages/core/src/storage/docStore/SimpleDocumentStore.ts:72


fromDict

fromDict(saveDict, namespace?): SimpleDocumentStore

Parameters

NameType
saveDictSaveDict
namespace?string

Returns

SimpleDocumentStore

Defined in

packages/core/src/storage/docStore/SimpleDocumentStore.ts:67


fromPersistDir

fromPersistDir(persistDir?, namespace?, fsModule?): Promise<SimpleDocumentStore>

Parameters

NameTypeDefault value
persistDirstringDEFAULT_PERSIST_DIR
namespace?stringundefined
fsModule?GenericFileSystemundefined

Returns

Promise<SimpleDocumentStore>

Defined in

packages/core/src/storage/docStore/SimpleDocumentStore.ts:25


fromPersistPath

fromPersistPath(persistPath, namespace?, fs?): Promise<SimpleDocumentStore>

Parameters

NameType
persistPathstring
namespace?string
fs?GenericFileSystem

Returns

Promise<SimpleDocumentStore>

Defined in

packages/core/src/storage/docStore/SimpleDocumentStore.ts:41