Version: 0.16.x

DataSyncConflictMongoDBDataProvider

Data Provider with update conflicts and optional conflict resolution that connects to the MongoDB database

Type parameters#

Type

Hierarchy#

DataSyncMongoDBDataProvider‹Type›

DataSyncConflictMongoDBDataProvider

Implements#

Index#

Constructors#

Properties#

Methods#

Constructors#

constructor#

+ new DataSyncConflictMongoDBDataProvider(model: ModelDefinition, client: any, dataSyncConflictConfig: DataSyncModelConflictConfig): DataSyncConflictMongoDBDataProvider

Overrides DataSyncMongoDBDataProvider.constructor

Defined in packages/graphback-datasync/src/providers/DataSyncConflictProvider.ts:15

Parameters:

NameType
modelModelDefinition
clientany
dataSyncConflictConfigDataSyncModelConflictConfig

Returns: DataSyncConflictMongoDBDataProvider

Properties#

Protected TTLinSeconds#

TTLinSeconds: number

Inherited from DataSyncMongoDBDataProvider.TTLinSeconds

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


Protected coerceTSFields#

coerceTSFields: boolean

Inherited from DataSyncMongoDBDataProvider.coerceTSFields

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


Protected collectionName#

collectionName: string

Inherited from DataSyncMongoDBDataProvider.collectionName

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


Protected conflictConfig#

conflictConfig: DataSyncModelConflictConfig

Defined in packages/graphback-datasync/src/providers/DataSyncConflictProvider.ts:14


Protected db#

db: Db

Inherited from DataSyncMongoDBDataProvider.db

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


Protected deltaSource#

deltaSource: MongoDeltaSource

Defined in packages/graphback-datasync/src/providers/DataSyncConflictProvider.ts:15


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:19

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:20

Parameters:

NameType
selectedFieldsstring[]

Returns: object

  • [ x: string]: any

Protected checkForConflict#

checkForConflict(clientData: any, base: any, serverData: any, operation: GraphbackOperationType): ConflictMetadata | undefined

Defined in packages/graphback-datasync/src/providers/DataSyncConflictProvider.ts:132

Parameters:

NameType
clientDataany
baseany
serverDataany
operationGraphbackOperationType

Returns: ConflictMetadata | undefined


count#

count(filter: QueryFilter): Promise‹number›

Implementation of DataSyncProvider

Inherited from DataSyncMongoDBDataProvider.count

Overrides void

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

Parameters:

NameType
filterQueryFilter

Returns: Promise‹number›


create#

create(data: any): Promise‹Type›

Overrides DataSyncMongoDBDataProvider.create

Defined in packages/graphback-datasync/src/providers/DataSyncConflictProvider.ts:28

Parameters:

NameType
dataany

Returns: Promise‹Type›


delete#

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

Overrides DataSyncMongoDBDataProvider.delete

Defined in packages/graphback-datasync/src/providers/DataSyncConflictProvider.ts:84

Parameters:

NameType
dataany
selectedFieldsstring[]

Returns: Promise‹Type›


findBy#

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

Implementation of DataSyncProvider

Inherited from DataSyncMongoDBDataProvider.findBy

Overrides void

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

Parameters:

NameType
args?FindByArgs
selectedFields?string[]

Returns: Promise‹Type[]›


findOne#

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

Inherited from DataSyncMongoDBDataProvider.findOne

Overrides void

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

Parameters:

NameType
filterany
selectedFields?string[]

Returns: Promise‹Type›


sync#

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

Implementation of DataSyncProvider

Inherited from DataSyncMongoDBDataProvider.sync

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

Parameters:

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

Returns: Promise‹Type[]›


update#

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

Overrides DataSyncMongoDBDataProvider.update

Defined in packages/graphback-datasync/src/providers/DataSyncConflictProvider.ts:39

Parameters:

NameType
updateDocumentany
selectedFieldsstring[]

Returns: Promise‹Type›