Skip to main content

Class: BaseProfileRouteMongo

Defined in: src/routes/mongo/BaseProfileRouteMongo.ts:10

Extends

Constructors

Constructor

new BaseProfileRouteMongo(): BaseProfileRouteMongo

Returns

BaseProfileRouteMongo

Inherited from

BaseProfileRoute.constructor

Properties

aclUtils?

protected optional aclUtils?: ACLUtils

Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:102

Inherited from

BaseProfileRoute.aclUtils


cacheClient?

protected optional cacheClient?: Redis

Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:104

The redis client that will be used as a 2nd level cache for all cacheable models.

Inherited from

BaseProfileRoute.cacheClient


config?

protected optional config?: any

Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:106

The global application configuration.

Inherited from

BaseProfileRoute.config


defaultACLUid

protected defaultACLUid: string

Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:108

The unique identifier of the default ACL for the model type.

Inherited from

BaseProfileRoute.defaultACLUid


logger

protected logger: any

Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:109

Inherited from

BaseProfileRoute.logger


notificationUtils?

protected optional notificationUtils?: NotificationUtils

Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:110

Inherited from

BaseProfileRoute.notificationUtils


objectFactory?

protected optional objectFactory?: ObjectFactory

Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:111

Inherited from

BaseProfileRoute.objectFactory


repoUtils?

protected optional repoUtils?: RepoUtils<ProfileMongo>

Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:115

The repository utility class to use for common operations.

Inherited from

BaseProfileRoute.repoUtils


repoUtilsClass

protected readonly repoUtilsClass: any

Defined in: node_modules/@rapidrest/service-core/dist/types/routes/CRUDRoute.d.ts:33

The class of the RepoUtils to use when instantiating the utility.

Inherited from

BaseProfileRoute.repoUtilsClass


trackChanges

protected trackChanges: number

Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:120

The number of previous document versions to store in the database. A negative value indicates storing all versions, a value of 0 stores no versions.

Inherited from

BaseProfileRoute.trackChanges


trustedRoles

protected trustedRoles: string[]

Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:121

Inherited from

BaseProfileRoute.trustedRoles

Accessors

modelClass

Get Signature

get modelClass(): any

Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:125

The class type of the model this route is associated with.

Returns

any

Inherited from

BaseProfileRoute.modelClass

Methods

count()

count(params, query, res, user?): Promise<any>

Defined in: node_modules/@rapidrest/service-core/dist/types/routes/CRUDRoute.d.ts:34

Parameters

params

any

query

any

res

HttpResponse

user?

JWTUser

Returns

Promise<any>

Inherited from

BaseProfileRoute.count


create()

create(obj, req, user?): Promise<ProfileMongo | ProfileMongo[]>

Defined in: node_modules/@rapidrest/service-core/dist/types/routes/CRUDRoute.d.ts:36

Parameters

obj

ProfileMongo | ProfileMongo[]

req

HttpRequest

user?

JWTUser

Returns

Promise<ProfileMongo | ProfileMongo[]>

Inherited from

BaseProfileRoute.create


delete()

delete(id, version, purge, req, user?): Promise<void>

Defined in: node_modules/@rapidrest/service-core/dist/types/routes/CRUDRoute.d.ts:37

Parameters

id

string

version

string | undefined

purge

string | undefined

req

HttpRequest

user?

JWTUser

Returns

Promise<void>

Inherited from

BaseProfileRoute.delete


doBulkCreate()

protected doBulkCreate(objs, options): Promise<ProfileMongo[]>

Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:154

Attempts to store a collection of objects provided in options.req.body into the datastore. Upon success, sets the newly persisted object(s) to the result property of the options.res argument, otherwise sends a 400 BAD REQUEST response to the client.

Parameters

objs

Partial<ProfileMongo>[]

The object(s) to store in the database.

options

CreateRequestOptions

The options to process the request using.

Returns

Promise<ProfileMongo[]>

Inherited from

BaseProfileRoute.doBulkCreate


doBulkUpdate()

protected doBulkUpdate(objs, options): Promise<ProfileMongo[]>

Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:206

Attempts to modify a collection of existing data model objects.

Parameters

objs

UpdateObject<ProfileMongo>[]

The object(s) to bulk update in the database.

options

UpdateRequestOptions<ProfileMongo>

The options to process the request using.

Returns

Promise<ProfileMongo[]>

Inherited from

BaseProfileRoute.doBulkUpdate


doCount()

protected doCount(options): Promise<HttpResponse>

Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:136

Attempts to retrieve the number of data model objects matching the given set of criteria as specified in the request query. Any results that have been found are set to the content-length header of the res argument.

Parameters

options

FindRequestOptions

The options to process the request using.

Returns

Promise<HttpResponse>

Inherited from

BaseProfileRoute.doCount


doCreate()

protected doCreate(obj, options): Promise<ProfileMongo | ProfileMongo[]>

Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:163

Attempts to store one or more objects provided in options.req.body into the datastore. Upon success, sets the newly persisted object(s) to the result property of the options.res argument, otherwise sends a 400 BAD REQUEST response to the client.

Parameters

obj

Partial<ProfileMongo> | Partial<ProfileMongo>[]

The object(s) to store in the database.

options

CreateRequestOptions

The options to process the request using.

Returns

Promise<ProfileMongo | ProfileMongo[]>

Inherited from

BaseProfileRoute.doCreate


doCreateObject()

protected doCreateObject(obj, options): Promise<ProfileMongo>

Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:145

Attempts to store an object provided in options.req.body into the datastore. Upon success, sets the newly persisted object(s) to the result property of the options.res argument, otherwise sends a 400 BAD REQUEST response to the client.

Parameters

obj

Partial<T>

The object to store in the database.

options

CreateRequestOptions

The options to process the request using.

Returns

Promise<ProfileMongo>

Inherited from

BaseProfileRoute.doCreateObject


doDelete()

protected doDelete(id, options): Promise<void>

Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:171

Attempts to delete an existing data model object with a given unique identifier encoded by the URI parameter id.

Parameters

id

string

The unique identifier of the object to delete.

options

DeleteRequestOptions

The options to process the request using.

Returns

Promise<void>

Inherited from

BaseProfileRoute.doDelete


doExists()

protected doExists(id, options): Promise<any>

Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:178

Attempts to determine if an existing object with the given unique identifier exists.

Parameters

id

string

The unique identifier of the object to verify exists.

options

FindRequestOptions

The options to process the request using.

Returns

Promise<any>

Inherited from

BaseProfileRoute.doExists


doFind()

protected doFind(options): Promise<ProfileMongo[]>

Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:186

Attempts to retrieve all data model objects matching the given set of criteria as specified in the request query. Any results that have been found are set to the result property of the res argument. result is never null.

Parameters

options

FindRequestOptions

The options to process the request using.

Returns

Promise<ProfileMongo[]>

Inherited from

BaseProfileRoute.doFind


doFindById()

protected doFindById(id, options): Promise<ProfileMongo | null>

Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:192

Attempts to retrieve a single data model object as identified by the id parameter in the URI.

Parameters

id

string

options

FindRequestOptions

The options to process the request using.

Returns

Promise<ProfileMongo | null>

Inherited from

BaseProfileRoute.doFindById


doTruncate()

protected doTruncate(options): Promise<void>

Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:199

Attempts to remove all entries of the data model type from the datastore matching the given parameters and query.

Parameters

options

TruncateRequestOptions

The options to process the request using.

Returns

Promise<void>

Inherited from

BaseProfileRoute.doTruncate


doUpdate()

protected doUpdate(id, obj, options): Promise<ProfileMongo>

Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:213

Attempts to modify an existing data model object as identified by the id parameter in the URI.

Parameters

id

string

obj

UpdateObject<ProfileMongo>

The object to update in the database

options

UpdateRequestOptions<ProfileMongo>

The options to process the request using.

Returns

Promise<ProfileMongo>

Inherited from

BaseProfileRoute.doUpdate


doUpdateProperty()

protected doUpdateProperty(id, propertyName, value, options): Promise<ProfileMongo>

Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:224

Attempts to modify a single property of an existing data model object as identified by the id parameter in the URI.

Note that this effectively bypasses optimistic locking and can cause unexpected data overwrites. Use with care.

Parameters

id

string

The unique identifier of the object to update.

propertyName

string

The name of the property to update.

value

any

The value of the property to set.

options

UpdateRequestOptions<ProfileMongo>

The options to process the request using.

Returns

Promise<ProfileMongo>

Inherited from

BaseProfileRoute.doUpdateProperty


exists()

exists(id, query, res, user?): Promise<any>

Defined in: node_modules/@rapidrest/service-core/dist/types/routes/CRUDRoute.d.ts:38

Parameters

id

string

query

any

res

HttpResponse

user?

JWTUser

Returns

Promise<any>

Inherited from

BaseProfileRoute.exists


find()

find(params, query, user?): Promise<ProfileMongo[]>

Defined in: node_modules/@rapidrest/service-core/dist/types/routes/CRUDRoute.d.ts:39

Parameters

params

any

query

any

user?

JWTUser

Returns

Promise<ProfileMongo[]>

Inherited from

BaseProfileRoute.find


findById()

findById(id, query, user?): Promise<ProfileMongo | null>

Defined in: node_modules/@rapidrest/service-core/dist/types/routes/CRUDRoute.d.ts:40

Parameters

id

string

query

any

user?

JWTUser

Returns

Promise<ProfileMongo | null>

Inherited from

BaseProfileRoute.findById


truncate()

truncate(params, query, user?): Promise<void>

Defined in: node_modules/@rapidrest/service-core/dist/types/routes/CRUDRoute.d.ts:41

Parameters

params

any

query

any

user?

JWTUser

Returns

Promise<void>

Inherited from

BaseProfileRoute.truncate


update()

update(id, obj, req, user?): Promise<ProfileMongo>

Defined in: node_modules/@rapidrest/service-core/dist/types/routes/CRUDRoute.d.ts:43

Parameters

id

string

obj

UpdateObject<ProfileMongo>

req

HttpRequest

user?

JWTUser

Returns

Promise<ProfileMongo>

Inherited from

BaseProfileRoute.update


updateBulk()

updateBulk(obj, req, user?): Promise<ProfileMongo[]>

Defined in: node_modules/@rapidrest/service-core/dist/types/routes/CRUDRoute.d.ts:45

Parameters

obj

UpdateObject<ProfileMongo>[]

req

HttpRequest

user?

JWTUser

Returns

Promise<ProfileMongo[]>

Inherited from

BaseProfileRoute.updateBulk


updateProperty()

updateProperty(id, propertyName, obj, user?): Promise<ProfileMongo>

Defined in: node_modules/@rapidrest/service-core/dist/types/routes/CRUDRoute.d.ts:46

Parameters

id

string

propertyName

string

obj

any

user?

JWTUser

Returns

Promise<ProfileMongo>

Inherited from

BaseProfileRoute.updateProperty


validate()

validate(objs, options?): Promise<void>

Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:228

Calls repoUtils.validate() to validate the object(s) provided.

Parameters

objs

Partial<ProfileMongo> | Partial<ProfileMongo>[]

options?

CreateRequestOptions | UpdateRequestOptions<ProfileMongo>

Returns

Promise<void>

Inherited from

BaseProfileRoute.validate


validateCreate()

protected validateCreate(obj, user?): Promise<void>

Defined in: node_modules/@rapidrest/service-core/dist/types/routes/CRUDRoute.d.ts:35

Parameters

obj

Partial<ProfileMongo> | Partial<ProfileMongo>[]

user?

JWTUser

Returns

Promise<void>

Inherited from

BaseProfileRoute.validateCreate


validateUpdate()

protected validateUpdate(id, obj, user?): Promise<void>

Defined in: node_modules/@rapidrest/service-core/dist/types/routes/CRUDRoute.d.ts:42

Parameters

id

string

obj

UpdateObject<ProfileMongo>

user?

JWTUser

Returns

Promise<void>

Inherited from

BaseProfileRoute.validateUpdate


validateUpdateBulk()

protected validateUpdateBulk(objs, user?): Promise<void>

Defined in: node_modules/@rapidrest/service-core/dist/types/routes/CRUDRoute.d.ts:44

Parameters

objs

UpdateObject<ProfileMongo>[]

user?

JWTUser

Returns

Promise<void>

Inherited from

BaseProfileRoute.validateUpdateBulk