Version: 1.0

DataSyncMongoDBDataProvider

Mongo provider that attains data synchronization using soft deletes

Type parameters

Type

Hierarchy

Implements

Index

Constructors

Properties

Methods

Constructors

constructor

+ new DataSyncMongoDBDataProvider(model: ModelDefinition, client: any): DataSyncMongoDBDataProvider

Overrides void

Defined in packages/graphback-datasync/src/providers/DatasyncMongoDBDataProvider.ts:11

Parameters:

NameType
modelModelDefinition
clientany

Returns: DataSyncMongoDBDataProvider

Properties

Protected TTLinSeconds

TTLinSeconds: number

Defined in packages/graphback-datasync/src/providers/DatasyncMongoDBDataProvider.ts:11


Protected collectionName

collectionName: string

Inherited from DataSyncMongoDBDataProvider.collectionName

Defined in packages/graphback-runtime-mongodb/types/MongoDBDataProvider.d.ts:8


Protected db

db: Db

Inherited from DataSyncMongoDBDataProvider.db

Defined in packages/graphback-runtime-mongodb/types/MongoDBDataProvider.d.ts:7


Protected fieldTransformMap

fieldTransformMap: FieldTransformMap

Inherited from DataSyncMongoDBDataProvider.fieldTransformMap

Defined in packages/graphback-runtime-mongodb/types/MongoDBDataProvider.d.ts:10


Protected tableMap

tableMap: ModelTableMap

Inherited from DataSyncMongoDBDataProvider.tableMap

Defined in packages/graphback-runtime-mongodb/types/MongoDBDataProvider.d.ts:9

Methods

batchRead

batchRead(relationField: string, ids: string[], filter?: QueryFilter, selectedFields?: string[]): Promise‹Type[][]›

Implementation of DataSyncProvider

Inherited from DataSyncMongoDBDataProvider.batchRead

Defined in packages/graphback-runtime-mongodb/types/MongoDBDataProvider.d.ts:18

Parameters:

NameType
relationFieldstring
idsstring[]
filter?QueryFilter
selectedFields?string[]

Returns: Promise‹Type[][]›


Protected buildProjectionOption

buildProjectionOption(selectedFields: string[]): object

Inherited from DataSyncMongoDBDataProvider.buildProjectionOption

Defined in packages/graphback-runtime-mongodb/types/MongoDBDataProvider.d.ts:19

Parameters:

NameType
selectedFieldsstring[]

Returns: object

  • [ x: string]: any

count

count(filter: QueryFilter): Promise‹number›

Implementation of DataSyncProvider

Overrides void

Defined in packages/graphback-datasync/src/providers/DatasyncMongoDBDataProvider.ts:122

Parameters:

NameType
filterQueryFilter

Returns: Promise‹number›


create

create(data: any): Promise‹Type›

Overrides void

Defined in packages/graphback-datasync/src/providers/DatasyncMongoDBDataProvider.ts:38

Parameters:

NameType
dataany

Returns: Promise‹Type›


delete

delete(data: any, selectedFields?: string[]): Promise‹Type›

Overrides void

Defined in packages/graphback-datasync/src/providers/DatasyncMongoDBDataProvider.ts:67

Parameters:

NameType
dataany
selectedFields?string[]

Returns: Promise‹Type›


findBy

findBy(args?: FindByArgs, selectedFields?: string[]): Promise‹Type[]›

Implementation of DataSyncProvider

Overrides void

Defined in packages/graphback-datasync/src/providers/DatasyncMongoDBDataProvider.ts:108

Parameters:

NameType
args?FindByArgs
selectedFields?string[]

Returns: Promise‹Type[]›


findOne

findOne(filter: any, selectedFields?: string[]): Promise‹Type›

Overrides void

Defined in packages/graphback-datasync/src/providers/DatasyncMongoDBDataProvider.ts:89

Parameters:

NameType
filterany
selectedFields?string[]

Returns: Promise‹Type›


sync

sync(lastSync: Date, selectedFields?: string[], filter?: QueryFilter, limit?: number): Promise‹Type[]›

Implementation of DataSyncProvider

Defined in packages/graphback-datasync/src/providers/DatasyncMongoDBDataProvider.ts:130

Parameters:

NameType
lastSyncDate
selectedFields?string[]
filter?QueryFilter
limit?number

Returns: Promise‹Type[]›


update

update(data: any, selectedFields?: string[]): Promise‹Type›

Overrides void

Defined in packages/graphback-datasync/src/providers/DatasyncMongoDBDataProvider.ts:45

Parameters:

NameType
dataany
selectedFields?string[]

Returns: Promise‹Type›