- Preparing search index...
- The search index is not available
Toolkit
Class DocumentsClient<DocumentType>
Constructors
constructor
- new DocumentsClient<DocumentType>(collection: string, typeguard?: TypeGuard<DocumentType>, reCaptchaToken?: string): DocumentsClient<DocumentType>
-
Parameters
-
collection: string
-
Optional typeguard: TypeGuard<DocumentType>
-
Optional reCaptchaToken: string
Methods
create
- create(documents: DocumentType | DocumentType[]): Promise<Response<AppDBDocument<DocumentType>>>
-
Parameters
-
documents: DocumentType | DocumentType[]
Returns Promise<Response<AppDBDocument<DocumentType>>>
delete
- delete(documents: string): Promise<Response<void>>
-
Returns Promise<Response<void>>
- delete(documents: string[]): Promise<Response<AppDBBulkDeleteResponse>>
-
Returns Promise<Response<AppDBBulkDeleteResponse>>
get
- get<T>(query?: FilterQuery<DocumentType>, queryParams?: {
avg?: string[];
count?: string;
groupby?: string[];
limit?: number;
max?: string[];
min?: string[];
offset?: number;
orderby?: string[];
sum?: string[];
[key: string]: string | number | string[] | undefined;
}): Promise<Response<T>>
-
Type Parameters
-
T = AppDBDocument<DocumentType>[]
Parameters
-
Optional query: FilterQuery<DocumentType>
-
Optional queryParams: {
avg?: string[];
count?: string;
groupby?: string[];
limit?: number;
max?: string[];
min?: string[];
offset?: number;
orderby?: string[];
sum?: string[];
[key: string]: string | number | string[] | undefined;
}
-
[key: string]: string | number | string[] | undefined
-
Optional avg?: string[]
-
Optional count?: string
-
Optional groupby?: string[]
-
Optional limit?: number
-
Optional max?: string[]
-
Optional min?: string[]
-
Optional offset?: number
-
Optional orderby?: string[]
-
Optional sum?: string[]
Returns Promise<Response<T>>
partialUpdate
- partialUpdate(query: FilterQuery<DocumentType>, operation: UpdateQuery<DocumentType>): Promise<Response<number>>
-
Parameters
-
query: FilterQuery<DocumentType>
-
operation: UpdateQuery<DocumentType>
Returns Promise<Response<number>>
update
- update(documents: AppDBUpdatedDocument<DocumentType>): Promise<Response<AppDBDocument<DocumentType>>>
-
Parameters
-
documents: AppDBUpdatedDocument<DocumentType>
Returns Promise<Response<AppDBDocument<DocumentType>>>
- update(documents: AppDBUpdatedDocument<DocumentType>[]): Promise<Response<AppDBBulkUpdateResponse>>
-
Parameters
-
documents: AppDBUpdatedDocument<DocumentType>[]
Returns Promise<Response<AppDBBulkUpdateResponse>>
SDK for interacting with documents in AppDB.
Example Usage