Class: BaseUserRouteMongo
Defined in: src/routes/mongo/BaseUserRouteMongo.ts:10
Extends
Constructors
Constructor
new BaseUserRouteMongo():
BaseUserRouteMongo
Returns
BaseUserRouteMongo
Inherited from
Properties
aclUtils?
protectedoptionalaclUtils?:ACLUtils
Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:102
Inherited from
cacheClient?
protectedoptionalcacheClient?: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
config?
protectedoptionalconfig?:any
Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:106
The global application configuration.
Inherited from
defaultACLUid
protecteddefaultACLUid: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
logger
protectedlogger:any
Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:109
Inherited from
notificationUtils?
protectedoptionalnotificationUtils?:NotificationUtils
Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:110
Inherited from
BaseUserRoute.notificationUtils
objectFactory?
protectedoptionalobjectFactory?:ObjectFactory
Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:111
Inherited from
repoUtils?
protectedoptionalrepoUtils?:RepoUtils<UserMongo>
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
repoUtilsClass
protectedreadonlyrepoUtilsClass: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
trackChanges
protectedtrackChanges: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
trustedRoles
protectedtrustedRoles:string[]
Defined in: node_modules/@rapidrest/service-core/dist/types/routes/ModelRoute.d.ts:121
Inherited from
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
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
create()
Defined in: node_modules/@rapidrest/service-core/dist/types/routes/CRUDRoute.d.ts:36
Parameters
obj
req
HttpRequest
user?
JWTUser
Returns
Promise<UserMongo | UserMongo[]>
Inherited from
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
doBulkCreate()
protecteddoBulkCreate(objs,options):Promise<UserMongo[]>
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<UserMongo>[]
The object(s) to store in the database.
options
CreateRequestOptions
The options to process the request using.
Returns
Promise<UserMongo[]>
Inherited from
doBulkUpdate()
protecteddoBulkUpdate(objs,options):Promise<UserMongo[]>
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<UserMongo>[]
The object(s) to bulk update in the database.
options
UpdateRequestOptions<UserMongo>
The options to process the request using.
Returns
Promise<UserMongo[]>
Inherited from
doCount()
protecteddoCount(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
doCreate()
protecteddoCreate(obj,options):Promise<UserMongo|UserMongo[]>
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<UserMongo> | Partial<UserMongo>[]
The object(s) to store in the database.
options
CreateRequestOptions
The options to process the request using.
Returns
Promise<UserMongo | UserMongo[]>
Inherited from
doCreateObject()
protecteddoCreateObject(obj,options):Promise<UserMongo>
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<UserMongo>
Inherited from
doDelete()
protecteddoDelete(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
doExists()
protecteddoExists(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
doFind()
protecteddoFind(options):Promise<UserMongo[]>
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<UserMongo[]>
Inherited from
doFindById()
protecteddoFindById(id,options):Promise<UserMongo|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<UserMongo | null>
Inherited from
doTruncate()
protecteddoTruncate(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
doUpdate()
protecteddoUpdate(id,obj,options):Promise<UserMongo>
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<UserMongo>
The object to update in the database
options
UpdateRequestOptions<UserMongo>
The options to process the request using.
Returns
Promise<UserMongo>
Inherited from
doUpdateProperty()
protecteddoUpdateProperty(id,propertyName,value,options):Promise<UserMongo>
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<UserMongo>
The options to process the request using.
Returns
Promise<UserMongo>
Inherited from
BaseUserRoute.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
find()
find(
params,query,user?):Promise<UserMongo[]>
Defined in: node_modules/@rapidrest/service-core/dist/types/routes/CRUDRoute.d.ts:39
Parameters
params
any
query
any
user?
JWTUser
Returns
Promise<UserMongo[]>
Inherited from
findById()
findById(
id,query,user?):Promise<UserMongo|null>
Defined in: node_modules/@rapidrest/service-core/dist/types/routes/CRUDRoute.d.ts:40
Parameters
id
string
query
any
user?
JWTUser
Returns
Promise<UserMongo | null>
Inherited from
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
update()
update(
id,obj,req,user?):Promise<UserMongo>
Defined in: node_modules/@rapidrest/service-core/dist/types/routes/CRUDRoute.d.ts:43
Parameters
id
string
obj
UpdateObject<UserMongo>
req
HttpRequest
user?
JWTUser
Returns
Promise<UserMongo>
Inherited from
updateBulk()
updateBulk(
obj,req,user?):Promise<UserMongo[]>
Defined in: node_modules/@rapidrest/service-core/dist/types/routes/CRUDRoute.d.ts:45
Parameters
obj
UpdateObject<UserMongo>[]
req
HttpRequest
user?
JWTUser
Returns
Promise<UserMongo[]>
Inherited from
updateProperty()
updateProperty(
id,propertyName,obj,user?):Promise<UserMongo>
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<UserMongo>
Inherited from
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<UserMongo> | Partial<UserMongo>[]
options?
CreateRequestOptions | UpdateRequestOptions<UserMongo>
Returns
Promise<void>
Inherited from
validateCreate()
protectedvalidateCreate(obj,user?):Promise<void>
Defined in: node_modules/@rapidrest/service-core/dist/types/routes/CRUDRoute.d.ts:35
Parameters
obj
Partial<UserMongo> | Partial<UserMongo>[]
user?
JWTUser
Returns
Promise<void>
Inherited from
validateUpdate()
protectedvalidateUpdate(id,obj,user?):Promise<void>
Defined in: node_modules/@rapidrest/service-core/dist/types/routes/CRUDRoute.d.ts:42
Parameters
id
string
obj
UpdateObject<UserMongo>
user?
JWTUser
Returns
Promise<void>
Inherited from
validateUpdateBulk()
protectedvalidateUpdateBulk(objs,user?):Promise<void>
Defined in: node_modules/@rapidrest/service-core/dist/types/routes/CRUDRoute.d.ts:44
Parameters
objs
UpdateObject<UserMongo>[]
user?
JWTUser
Returns
Promise<void>