共用方式為


IExtensionDataManager interface

方法

createDocument(string, any, IDocumentOptions)

傳回在所提供集合中建立文件的承諾

deleteDocument(string, string, IDocumentOptions)

傳回在所提供範圍、集合和標識碼上刪除文件的承諾

getDocument(string, string, IDocumentOptions)

傳回在所提供集合中取得具有所提供標識符的文件的承諾

getDocuments(string, IDocumentOptions)

傳回取得所提供集合中所有文件的承諾

getValue<T>(string, IDocumentOptions)

傳回在提供之金鑰和範圍擷取設定的承諾

queryCollections(ExtensionDataCollection[])

傳回查詢一組集合的承諾

queryCollectionsByName(string[])

傳回查詢一組集合的承諾

setDocument(string, any, IDocumentOptions)

傳回在所提供集合中設定文件的承諾:如果檔不存在,則會建立文件,否則會以提供的標識碼更新現有的檔

setValue<T>(string, T, IDocumentOptions)

傳回在提供之金鑰和範圍儲存設定的承諾

updateDocument(string, any, IDocumentOptions)

傳回在所提供集合中更新文件的承諾:具有提供的標識碼的文件必須存在

方法詳細資料

createDocument(string, any, IDocumentOptions)

傳回在所提供集合中建立文件的承諾

function createDocument(collectionName: string, doc: any, documentOptions?: IDocumentOptions): Promise<any>

參數

collectionName

string

檔所在集合的名稱

doc

any

要儲存的檔

documentOptions
IDocumentOptions

延伸模組檔選項,預設範圍值為全帳戶

傳回

Promise<any>

deleteDocument(string, string, IDocumentOptions)

傳回在所提供範圍、集合和標識碼上刪除文件的承諾

function deleteDocument(collectionName: string, id: string, documentOptions?: IDocumentOptions): Promise<void>

參數

collectionName

string

檔所在集合的名稱

id

string

集合中文件的識別碼

documentOptions
IDocumentOptions

延伸模組檔選項,預設範圍值為全帳戶

傳回

Promise<void>

getDocument(string, string, IDocumentOptions)

傳回在所提供集合中取得具有所提供標識符的文件的承諾

function getDocument(collectionName: string, id: string, documentOptions?: IDocumentOptions): Promise<any>

參數

collectionName

string

檔所在集合的名稱

id

string

集合中文件的識別碼

documentOptions
IDocumentOptions

延伸模組檔選項,預設範圍值為全帳戶

傳回

Promise<any>

getDocuments(string, IDocumentOptions)

傳回取得所提供集合中所有文件的承諾

function getDocuments(collectionName: string, documentOptions?: IDocumentOptions): Promise<any[]>

參數

collectionName

string

檔所在集合的名稱

documentOptions
IDocumentOptions

延伸模組檔選項,預設範圍值為全帳戶

傳回

Promise<any[]>

getValue<T>(string, IDocumentOptions)

傳回在提供之金鑰和範圍擷取設定的承諾

function getValue<T>(key: string, documentOptions?: IDocumentOptions): Promise<T>

參數

key

string

要擷取值的索引鍵

documentOptions
IDocumentOptions

延伸模組檔選項,預設範圍值為全帳戶

傳回

Promise<T>

queryCollections(ExtensionDataCollection[])

傳回查詢一組集合的承諾

function queryCollections(collections: ExtensionDataCollection[]): Promise<ExtensionDataCollection[]>

參數

collections

ExtensionDataCollection[]

要查詢的集合清單。 每個集合都會包含其 collectionName、scopeType 和 scopeValue

傳回

queryCollectionsByName(string[])

傳回查詢一組集合的承諾

function queryCollectionsByName(collectionNames: string[]): Promise<ExtensionDataCollection[]>

參數

collectionNames

string[]

傳回

setDocument(string, any, IDocumentOptions)

傳回在所提供集合中設定文件的承諾:如果檔不存在,則會建立文件,否則會以提供的標識碼更新現有的檔

function setDocument(collectionName: string, doc: any, documentOptions?: IDocumentOptions): Promise<any>

參數

collectionName

string

檔所在集合的名稱

doc

any

要儲存的檔

documentOptions
IDocumentOptions

延伸模組檔選項,預設範圍值為全帳戶

傳回

Promise<any>

setValue<T>(string, T, IDocumentOptions)

傳回在提供之金鑰和範圍儲存設定的承諾

function setValue<T>(key: string, value: T, documentOptions?: IDocumentOptions): Promise<T>

參數

key

string

要儲存值的索引鍵

value

T

要儲存的值

documentOptions
IDocumentOptions

延伸模組檔選項,預設範圍值為全帳戶

傳回

Promise<T>

updateDocument(string, any, IDocumentOptions)

傳回在所提供集合中更新文件的承諾:具有提供的標識碼的文件必須存在

function updateDocument(collectionName: string, doc: any, documentOptions?: IDocumentOptions): Promise<any>

參數

collectionName

string

檔所在集合的名稱

doc

any

要儲存的檔

documentOptions
IDocumentOptions

延伸模組檔選項,預設範圍值為全帳戶

傳回

Promise<any>