Version: next

DataSyncMongoDBDataProvider

Mongo provider that attains data synchronization using soft deletes

Type parameters

Type

Hierarchy

  • MongoDBDataProvider‹Type›

    DataSyncMongoDBDataProvider

Implements

Index

Constructors

Properties

Methods

Constructors

constructor

+ new DataSyncMongoDBDataProvider(baseType: GraphQLObjectType, client: any): DataSyncMongoDBDataProvider

Overrides void

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

Parameters:

NameType
baseTypeGraphQLObjectType
clientany

Returns: DataSyncMongoDBDataProvider

Properties

Protected coerceTSFields

coerceTSFields: boolean

Inherited from DataSyncMongoDBDataProvider.coerceTSFields

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


Protected collectionName

collectionName: string

Inherited from DataSyncMongoDBDataProvider.collectionName

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


Protected db

db: Db

Inherited from DataSyncMongoDBDataProvider.db

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


Protected fieldTransformMap

fieldTransformMap: FieldTransformMap

Inherited from DataSyncMongoDBDataProvider.fieldTransformMap

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


Protected tableMap

tableMap: ModelTableMap

Inherited from DataSyncMongoDBDataProvider.tableMap

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

Methods

batchRead

batchRead(relationField: string, ids: string[], filter: any, context: GraphbackContext): Promise‹Type[][]›

Inherited from DataSyncMongoDBDataProvider.batchRead

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

Parameters:

NameType
relationFieldstring
idsstring[]
filterany
contextGraphbackContext

Returns: Promise‹Type[][]›


Protected buildProjectionOption

buildProjectionOption(context: GraphbackContext): object

Inherited from DataSyncMongoDBDataProvider.buildProjectionOption

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

Parameters:

NameType
contextGraphbackContext

Returns: object

  • [ x: string]: any

Protected checkForConflicts

checkForConflicts(clientData: any, context: GraphbackContext): Promise‹ConflictStateMap

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

Parameters:

NameType
clientDataany
contextGraphbackContext

Returns: Promise‹ConflictStateMap


count

count(filter: any): Promise‹number›

Implementation of DataSyncProvider

Overrides void

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

Parameters:

NameType
filterany

Returns: Promise‹number›


create

create(data: any, context: GraphbackContext): Promise‹Type›

Overrides void

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

Parameters:

NameType
dataany
contextGraphbackContext

Returns: Promise‹Type›


delete

delete(data: any, context: GraphbackContext): Promise‹Type›

Overrides void

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

Parameters:

NameType
dataany
contextGraphbackContext

Returns: Promise‹Type›


findBy

findBy(filter: QueryFilter‹Type› | any, context: GraphbackContext, page?: GraphbackPage, orderBy?: GraphbackOrderBy): Promise‹Type[]›

Overrides void

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

Parameters:

NameType
filterQueryFilter‹Type› | any
contextGraphbackContext
page?GraphbackPage
orderBy?GraphbackOrderBy

Returns: Promise‹Type[]›


findOne

findOne(filter: any, context: GraphbackContext): Promise‹Type›

Overrides void

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

Parameters:

NameType
filterany
contextGraphbackContext

Returns: Promise‹Type›


Protected mapFields

mapFields(document: any): any

Inherited from DataSyncMongoDBDataProvider.mapFields

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

Parameters:

NameType
documentany

Returns: any


sync

sync(lastSync: string, context: GraphbackContext, filter?: any): Promise‹Type[]›

Implementation of DataSyncProvider

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

Parameters:

NameType
lastSyncstring
contextGraphbackContext
filter?any

Returns: Promise‹Type[]›


update

update(data: any, context: GraphbackContext): Promise‹Type›

Overrides void

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

Parameters:

NameType
dataany
contextGraphbackContext

Returns: Promise‹Type›