@webiny/commodo-fields-storage-db-proxy
Version:
A MongoDB driver for the [fields-storage](../fields-storage) package.
46 lines (45 loc) • 1.15 kB
TypeScript
declare class DbProxyClient {
dbProxyFunction: string;
constructor({ dbProxyFunction }: {
dbProxyFunction: any;
});
runOperation(requestPayload: any): Promise<any>;
}
declare type Item = {
name: string;
query: {
[key: string]: any;
};
data: {
[key: string]: any;
};
};
declare class DbProxyDriver {
client: DbProxyClient;
constructor({ dbProxyFunction }?: {
dbProxyFunction?: string;
});
create(items: Item[]): Promise<boolean>;
update(items: Item[]): Promise<boolean>;
delete({ name, options }: {
name: any;
options: any;
}): Promise<boolean>;
find({ name, options }: {
name: any;
options: any;
}): Promise<{}[]>;
findOne({ name, options }: {
name: any;
options: any;
}): Promise<any>;
count({ name, options }: {
name: any;
options: any;
}): Promise<any>;
getCollectionName(name: any): any;
getClient(): DbProxyClient;
static __prepareSearchOption(options: any): void;
static __prepareProjectFields(options: any): void;
}
export default DbProxyDriver;