@rapidrest/service-core 1.0.0-beta.6 → 1.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/database/MongoRepository.js +22 -24
- package/dist/lib/database/MongoRepository.js.map +1 -1
- package/dist/lib/database/MongoSchemaSync.js +80 -21
- package/dist/lib/database/MongoSchemaSync.js.map +1 -1
- package/dist/lib/database/NamingUtils.js +4 -4
- package/dist/lib/database/NamingUtils.js.map +1 -1
- package/dist/lib/decorators/PersistenceDecorators.js +17 -17
- package/dist/lib/decorators/PersistenceDecorators.js.map +1 -1
- package/dist/lib/models/BaseMongoEntity.js +10 -3
- package/dist/lib/models/BaseMongoEntity.js.map +1 -1
- package/dist/lib/models/ModelUtils.js +31 -34
- package/dist/lib/models/ModelUtils.js.map +1 -1
- package/dist/lib/models/RecoverableBaseMongoEntity.js +11 -3
- package/dist/lib/models/RecoverableBaseMongoEntity.js.map +1 -1
- package/dist/lib/models/RepoUtils.js +37 -45
- package/dist/lib/models/RepoUtils.js.map +1 -1
- package/dist/lib/models/SimpleEntity.js +1 -1
- package/dist/lib/models/SimpleEntity.js.map +1 -1
- package/dist/lib/routes/ModelRoute.js +1 -11
- package/dist/lib/routes/ModelRoute.js.map +1 -1
- package/dist/types/database/MongoRepository.d.ts +17 -11
- package/dist/types/database/MongoSchemaSync.d.ts +25 -3
- package/dist/types/database/NamingUtils.d.ts +1 -1
- package/dist/types/decorators/PersistenceDecorators.d.ts +29 -3
- package/dist/types/models/ModelUtils.d.ts +3 -6
- package/dist/types/models/RepoUtils.d.ts +1 -7
- package/dist/types/routes/ModelRoute.d.ts +0 -4
- package/docs/reference/@rapidrest/namespaces/DatabaseDecorators/functions/MongoRepository.md +1 -1
- package/docs/reference/@rapidrest/namespaces/DatabaseDecorators/functions/RedisConnection.md +1 -1
- package/docs/reference/@rapidrest/namespaces/DatabaseDecorators/functions/Repository.md +1 -1
- package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Default.md +1 -1
- package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Description.md +1 -1
- package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Document.md +1 -1
- package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Example.md +1 -1
- package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Format.md +1 -1
- package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Returns.md +1 -1
- package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Summary.md +1 -1
- package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/Tags.md +1 -1
- package/docs/reference/@rapidrest/namespaces/DocDecorators/functions/TypeInfo.md +1 -1
- package/docs/reference/@rapidrest/namespaces/DocDecorators/interfaces/DocumentsData.md +7 -7
- package/docs/reference/@rapidrest/namespaces/EventDecorators/functions/EventListener.md +1 -1
- package/docs/reference/@rapidrest/namespaces/EventDecorators/functions/OnEvent.md +1 -1
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/Cache.md +1 -1
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/ChildEntity.md +2 -2
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/DataStore.md +1 -1
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/Identifier.md +1 -1
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/Protect.md +5 -5
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/Reference.md +1 -1
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/Shard.md +1 -1
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/functions/TrackChanges.md +2 -2
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/interfaces/PendingTypeOrmColumn.md +7 -7
- package/docs/reference/@rapidrest/namespaces/ModelDecorators/variables/pendingTypeOrmColumns.md +2 -2
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/README.md +2 -0
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/Column.md +1 -1
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/Entity.md +5 -6
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/Index.md +3 -3
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/PrimaryColumn.md +1 -1
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/Unique.md +3 -3
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/getColumnMetadata.md +1 -1
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/getEntityName.md +1 -1
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/functions/getIndexMetadata.md +1 -1
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/interfaces/CollationOptions.md +79 -0
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/interfaces/ColumnInfo.md +4 -4
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/interfaces/ColumnOptions.md +5 -5
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/interfaces/EntityOptions.md +32 -0
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/interfaces/IndexInfo.md +4 -4
- package/docs/reference/@rapidrest/namespaces/PersistenceDecorators/interfaces/IndexOptions.md +15 -5
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/After.md +1 -1
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Auth.md +1 -1
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/AuthResult.md +1 -1
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Before.md +1 -1
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/ContentType.md +1 -1
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Delete.md +1 -1
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Get.md +1 -1
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Head.md +1 -1
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Header.md +1 -1
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Method.md +1 -1
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Model.md +1 -1
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Options.md +1 -1
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Param.md +1 -1
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Patch.md +1 -1
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Post.md +1 -1
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Protect.md +1 -1
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Put.md +1 -1
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Query.md +1 -1
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Request.md +1 -1
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/RequiresRole.md +1 -1
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Response.md +1 -1
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Route.md +1 -1
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Socket.md +1 -1
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/User.md +1 -1
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/Validate.md +1 -1
- package/docs/reference/@rapidrest/namespaces/RouteDecorators/functions/WebSocket.md +1 -1
- package/docs/reference/classes/ACLUtils.md +10 -10
- package/docs/reference/classes/AdminRoute.md +3 -3
- package/docs/reference/classes/AuthMiddleware.md +6 -6
- package/docs/reference/classes/BackgroundService.md +8 -8
- package/docs/reference/classes/BackgroundServiceManager.md +7 -7
- package/docs/reference/classes/BaseEntity.md +6 -6
- package/docs/reference/classes/BaseMongoEntity.md +7 -7
- package/docs/reference/classes/BasicStrategy.md +5 -5
- package/docs/reference/classes/BasicStrategyOptions.md +7 -7
- package/docs/reference/classes/BulkError.md +3 -3
- package/docs/reference/classes/ConnectionManager.md +4 -4
- package/docs/reference/classes/EventListenerManager.md +5 -5
- package/docs/reference/classes/HttpRouter.md +16 -16
- package/docs/reference/classes/JWTStrategy.md +5 -5
- package/docs/reference/classes/JWTStrategyOptions.md +8 -8
- package/docs/reference/classes/MetricsRoute.md +2 -2
- package/docs/reference/classes/ModelRoute.md +46 -46
- package/docs/reference/classes/ModelUtils.md +13 -31
- package/docs/reference/classes/MongoConnection.md +12 -12
- package/docs/reference/classes/MongoRepository.md +73 -37
- package/docs/reference/classes/MongoSchemaSync.md +37 -7
- package/docs/reference/classes/NetUtils.md +3 -3
- package/docs/reference/classes/NotificationUtils.md +3 -3
- package/docs/reference/classes/ObjectFactory.md +3 -3
- package/docs/reference/classes/OpenAPIRoute.md +5 -5
- package/docs/reference/classes/OpenApiSpec.md +45 -45
- package/docs/reference/classes/RecoverableBaseEntity.md +7 -7
- package/docs/reference/classes/RecoverableBaseMongoEntity.md +8 -8
- package/docs/reference/classes/RedisTransport.md +4 -4
- package/docs/reference/classes/RepoUtils.md +36 -40
- package/docs/reference/classes/RouteUtils.md +7 -7
- package/docs/reference/classes/Server.md +26 -26
- package/docs/reference/classes/SimpleEntity.md +3 -3
- package/docs/reference/classes/SimpleMongoEntity.md +4 -4
- package/docs/reference/classes/StatusExtraData.md +4 -4
- package/docs/reference/classes/StatusRoute.md +1 -1
- package/docs/reference/classes/UWSRequest.md +16 -16
- package/docs/reference/classes/UWSResponse.md +13 -13
- package/docs/reference/classes/UWSWebSocketShim.md +5 -5
- package/docs/reference/enumerations/ACLAction.md +7 -7
- package/docs/reference/enumerations/ApiErrorMessages.md +15 -15
- package/docs/reference/enumerations/ApiErrors.md +15 -15
- package/docs/reference/functions/createWebSocketStream.md +1 -1
- package/docs/reference/functions/isSqlDataSource.md +1 -1
- package/docs/reference/functions/readBody.md +1 -1
- package/docs/reference/functions/resolveCollectionName.md +2 -2
- package/docs/reference/functions/runChain.md +1 -1
- package/docs/reference/functions/snakeCase.md +1 -1
- package/docs/reference/interfaces/ACLRecord.md +8 -8
- package/docs/reference/interfaces/AccessControlList.md +5 -5
- package/docs/reference/interfaces/AuthResult.md +5 -5
- package/docs/reference/interfaces/AuthStrategy.md +4 -4
- package/docs/reference/interfaces/CreateRequestOptions.md +9 -9
- package/docs/reference/interfaces/DeleteRequestOptions.md +10 -20
- package/docs/reference/interfaces/FindRequestOptions.md +10 -10
- package/docs/reference/interfaces/HttpRequest.md +15 -15
- package/docs/reference/interfaces/HttpResponse.md +11 -11
- package/docs/reference/interfaces/JWTAuthResult.md +6 -6
- package/docs/reference/interfaces/RepoCreateOptions.md +7 -7
- package/docs/reference/interfaces/RepoDeleteOptions.md +8 -18
- package/docs/reference/interfaces/RepoFindOptions.md +10 -20
- package/docs/reference/interfaces/RepoOperationOptions.md +6 -6
- package/docs/reference/interfaces/RepoUpdateOptions.md +7 -17
- package/docs/reference/interfaces/RequestOptions.md +8 -8
- package/docs/reference/interfaces/RequestWS.md +17 -17
- package/docs/reference/interfaces/TruncateRequestOptions.md +12 -26
- package/docs/reference/interfaces/UpdateRequestOptions.md +10 -20
- package/docs/reference/type-aliases/ErrorHandler.md +1 -1
- package/docs/reference/type-aliases/NextFunction.md +1 -1
- package/docs/reference/type-aliases/OneOrMany.md +1 -1
- package/docs/reference/type-aliases/OneOrNull.md +1 -1
- package/docs/reference/type-aliases/PartialBaseEntity.md +1 -1
- package/docs/reference/type-aliases/PartialSimpleEntity.md +1 -1
- package/docs/reference/type-aliases/RequestHandler.md +1 -1
- package/docs/reference/type-aliases/UpdateObject.md +1 -1
- package/docs/reference/type-aliases/WsUpgradeAuth.md +1 -1
- package/docs/reference/type-aliases/WsUpgradeAuthResult.md +5 -5
- package/package.json +1 -1
|
@@ -6,18 +6,18 @@
|
|
|
6
6
|
|
|
7
7
|
# Abstract Class: ModelRoute\<T\>
|
|
8
8
|
|
|
9
|
-
Defined in: [src/routes/ModelRoute.ts:
|
|
9
|
+
Defined in: [src/routes/ModelRoute.ts:113](https://github.com/rapidrest/service-core/blob/33d3655fa6883713f33f0fe6f330eb205671fea1/src/routes/ModelRoute.ts#L113)
|
|
10
10
|
|
|
11
|
-
The `ModelRoute` is an abstract base class that provides a set of built-in route behavior functions for handling
|
|
11
|
+
The `ModelRoute` is an abstract base class that provides a set of built-in route behavior functions for handling
|
|
12
12
|
requests for a given data model that is managed by a persistent datastore.
|
|
13
13
|
|
|
14
|
-
Provided behaviors:
|
|
15
|
-
* `count` - Counts the number of objects matching the provided set of criteria in the request's query parameters.
|
|
16
|
-
* `create` - Adds a new object to the datastore.
|
|
17
|
-
* `delete` - Removes an existing object from the datastore.
|
|
18
|
-
* `find` - Finds all objects matching the provided set of criteria in the request's query parameters.
|
|
19
|
-
* `findById` - Finds a single object with a specified unique identifier.
|
|
20
|
-
* `truncate` - Removes all objects from the datastore.
|
|
14
|
+
Provided behaviors:
|
|
15
|
+
* `count` - Counts the number of objects matching the provided set of criteria in the request's query parameters.
|
|
16
|
+
* `create` - Adds a new object to the datastore.
|
|
17
|
+
* `delete` - Removes an existing object from the datastore.
|
|
18
|
+
* `find` - Finds all objects matching the provided set of criteria in the request's query parameters.
|
|
19
|
+
* `findById` - Finds a single object with a specified unique identifier.
|
|
20
|
+
* `truncate` - Removes all objects from the datastore.
|
|
21
21
|
* `update` - Modifies an existing object in the datastore.
|
|
22
22
|
|
|
23
23
|
## Author
|
|
@@ -46,7 +46,7 @@ Jean-Philippe Steinmetz
|
|
|
46
46
|
|
|
47
47
|
> `protected` `optional` **aclUtils?**: [`ACLUtils`](ACLUtils.md)
|
|
48
48
|
|
|
49
|
-
Defined in: [src/routes/ModelRoute.ts:
|
|
49
|
+
Defined in: [src/routes/ModelRoute.ts:115](https://github.com/rapidrest/service-core/blob/33d3655fa6883713f33f0fe6f330eb205671fea1/src/routes/ModelRoute.ts#L115)
|
|
50
50
|
|
|
51
51
|
***
|
|
52
52
|
|
|
@@ -54,7 +54,7 @@ Defined in: [src/routes/ModelRoute.ts:119](https://github.com/rapidrest/service-
|
|
|
54
54
|
|
|
55
55
|
> `protected` `optional` **cacheClient?**: `Redis`
|
|
56
56
|
|
|
57
|
-
Defined in: [src/routes/ModelRoute.ts:
|
|
57
|
+
Defined in: [src/routes/ModelRoute.ts:119](https://github.com/rapidrest/service-core/blob/33d3655fa6883713f33f0fe6f330eb205671fea1/src/routes/ModelRoute.ts#L119)
|
|
58
58
|
|
|
59
59
|
The redis client that will be used as a 2nd level cache for all cacheable models.
|
|
60
60
|
|
|
@@ -64,7 +64,7 @@ The redis client that will be used as a 2nd level cache for all cacheable models
|
|
|
64
64
|
|
|
65
65
|
> `protected` `optional` **config?**: `any`
|
|
66
66
|
|
|
67
|
-
Defined in: [src/routes/ModelRoute.ts:
|
|
67
|
+
Defined in: [src/routes/ModelRoute.ts:123](https://github.com/rapidrest/service-core/blob/33d3655fa6883713f33f0fe6f330eb205671fea1/src/routes/ModelRoute.ts#L123)
|
|
68
68
|
|
|
69
69
|
The global application configuration.
|
|
70
70
|
|
|
@@ -74,7 +74,7 @@ The global application configuration.
|
|
|
74
74
|
|
|
75
75
|
> `protected` **defaultACLUid**: `string` = `""`
|
|
76
76
|
|
|
77
|
-
Defined in: [src/routes/ModelRoute.ts:
|
|
77
|
+
Defined in: [src/routes/ModelRoute.ts:126](https://github.com/rapidrest/service-core/blob/33d3655fa6883713f33f0fe6f330eb205671fea1/src/routes/ModelRoute.ts#L126)
|
|
78
78
|
|
|
79
79
|
The unique identifier of the default ACL for the model type.
|
|
80
80
|
|
|
@@ -84,7 +84,7 @@ The unique identifier of the default ACL for the model type.
|
|
|
84
84
|
|
|
85
85
|
> `protected` **logger**: `any`
|
|
86
86
|
|
|
87
|
-
Defined in: [src/routes/ModelRoute.ts:
|
|
87
|
+
Defined in: [src/routes/ModelRoute.ts:129](https://github.com/rapidrest/service-core/blob/33d3655fa6883713f33f0fe6f330eb205671fea1/src/routes/ModelRoute.ts#L129)
|
|
88
88
|
|
|
89
89
|
***
|
|
90
90
|
|
|
@@ -92,7 +92,7 @@ Defined in: [src/routes/ModelRoute.ts:133](https://github.com/rapidrest/service-
|
|
|
92
92
|
|
|
93
93
|
> `protected` `optional` **notificationUtils?**: [`NotificationUtils`](NotificationUtils.md)
|
|
94
94
|
|
|
95
|
-
Defined in: [src/routes/ModelRoute.ts:
|
|
95
|
+
Defined in: [src/routes/ModelRoute.ts:132](https://github.com/rapidrest/service-core/blob/33d3655fa6883713f33f0fe6f330eb205671fea1/src/routes/ModelRoute.ts#L132)
|
|
96
96
|
|
|
97
97
|
***
|
|
98
98
|
|
|
@@ -100,7 +100,7 @@ Defined in: [src/routes/ModelRoute.ts:136](https://github.com/rapidrest/service-
|
|
|
100
100
|
|
|
101
101
|
> `protected` `optional` **objectFactory?**: [`ObjectFactory`](ObjectFactory.md)
|
|
102
102
|
|
|
103
|
-
Defined in: [src/routes/ModelRoute.ts:
|
|
103
|
+
Defined in: [src/routes/ModelRoute.ts:135](https://github.com/rapidrest/service-core/blob/33d3655fa6883713f33f0fe6f330eb205671fea1/src/routes/ModelRoute.ts#L135)
|
|
104
104
|
|
|
105
105
|
***
|
|
106
106
|
|
|
@@ -108,7 +108,7 @@ Defined in: [src/routes/ModelRoute.ts:139](https://github.com/rapidrest/service-
|
|
|
108
108
|
|
|
109
109
|
> `protected` `optional` **repoUtils?**: [`RepoUtils`](RepoUtils.md)\<`T`\>
|
|
110
110
|
|
|
111
|
-
Defined in: [src/routes/ModelRoute.ts:
|
|
111
|
+
Defined in: [src/routes/ModelRoute.ts:141](https://github.com/rapidrest/service-core/blob/33d3655fa6883713f33f0fe6f330eb205671fea1/src/routes/ModelRoute.ts#L141)
|
|
112
112
|
|
|
113
113
|
The repository utility class to use for common operations.
|
|
114
114
|
|
|
@@ -118,7 +118,7 @@ The repository utility class to use for common operations.
|
|
|
118
118
|
|
|
119
119
|
> `abstract` `protected` `readonly` **repoUtilsClass**: `any`
|
|
120
120
|
|
|
121
|
-
Defined in: [src/routes/ModelRoute.ts:
|
|
121
|
+
Defined in: [src/routes/ModelRoute.ts:138](https://github.com/rapidrest/service-core/blob/33d3655fa6883713f33f0fe6f330eb205671fea1/src/routes/ModelRoute.ts#L138)
|
|
122
122
|
|
|
123
123
|
The class of the RepoUtils to use when instantiating the utility.
|
|
124
124
|
|
|
@@ -128,9 +128,9 @@ The class of the RepoUtils to use when instantiating the utility.
|
|
|
128
128
|
|
|
129
129
|
> `protected` **trackChanges**: `number` = `0`
|
|
130
130
|
|
|
131
|
-
Defined in: [src/routes/ModelRoute.ts:
|
|
131
|
+
Defined in: [src/routes/ModelRoute.ts:147](https://github.com/rapidrest/service-core/blob/33d3655fa6883713f33f0fe6f330eb205671fea1/src/routes/ModelRoute.ts#L147)
|
|
132
132
|
|
|
133
|
-
The number of previous document versions to store in the database. A negative value indicates storing all
|
|
133
|
+
The number of previous document versions to store in the database. A negative value indicates storing all
|
|
134
134
|
versions, a value of `0` stores no versions.
|
|
135
135
|
|
|
136
136
|
***
|
|
@@ -139,7 +139,7 @@ versions, a value of `0` stores no versions.
|
|
|
139
139
|
|
|
140
140
|
> `protected` **trustedRoles**: `string`[]
|
|
141
141
|
|
|
142
|
-
Defined in: [src/routes/ModelRoute.ts:
|
|
142
|
+
Defined in: [src/routes/ModelRoute.ts:150](https://github.com/rapidrest/service-core/blob/33d3655fa6883713f33f0fe6f330eb205671fea1/src/routes/ModelRoute.ts#L150)
|
|
143
143
|
|
|
144
144
|
## Accessors
|
|
145
145
|
|
|
@@ -149,7 +149,7 @@ Defined in: [src/routes/ModelRoute.ts:154](https://github.com/rapidrest/service-
|
|
|
149
149
|
|
|
150
150
|
> **get** `protected` **modelClass**(): `any`
|
|
151
151
|
|
|
152
|
-
Defined in: [src/routes/ModelRoute.ts:
|
|
152
|
+
Defined in: [src/routes/ModelRoute.ts:155](https://github.com/rapidrest/service-core/blob/33d3655fa6883713f33f0fe6f330eb205671fea1/src/routes/ModelRoute.ts#L155)
|
|
153
153
|
|
|
154
154
|
The class type of the model this route is associated with.
|
|
155
155
|
|
|
@@ -163,10 +163,10 @@ The class type of the model this route is associated with.
|
|
|
163
163
|
|
|
164
164
|
> `protected` **doBulkCreate**(`objs`, `options`): `Promise`\<`T`[]\>
|
|
165
165
|
|
|
166
|
-
Defined in: [src/routes/ModelRoute.ts:
|
|
166
|
+
Defined in: [src/routes/ModelRoute.ts:253](https://github.com/rapidrest/service-core/blob/33d3655fa6883713f33f0fe6f330eb205671fea1/src/routes/ModelRoute.ts#L253)
|
|
167
167
|
|
|
168
|
-
Attempts to store a collection of objects provided in `options.req.body` into the datastore. Upon success, sets the newly persisted
|
|
169
|
-
object(s) to the `result` property of the `options.res` argument, otherwise sends a `400 BAD REQUEST` response to the
|
|
168
|
+
Attempts to store a collection of objects provided in `options.req.body` into the datastore. Upon success, sets the newly persisted
|
|
169
|
+
object(s) to the `result` property of the `options.res` argument, otherwise sends a `400 BAD REQUEST` response to the
|
|
170
170
|
client.
|
|
171
171
|
|
|
172
172
|
#### Parameters
|
|
@@ -193,7 +193,7 @@ The options to process the request using.
|
|
|
193
193
|
|
|
194
194
|
> `protected` **doBulkUpdate**(`objs`, `options`): `Promise`\<`T`[]\>
|
|
195
195
|
|
|
196
|
-
Defined in: [src/routes/ModelRoute.ts:
|
|
196
|
+
Defined in: [src/routes/ModelRoute.ts:511](https://github.com/rapidrest/service-core/blob/33d3655fa6883713f33f0fe6f330eb205671fea1/src/routes/ModelRoute.ts#L511)
|
|
197
197
|
|
|
198
198
|
Attempts to modify a collection of existing data model objects.
|
|
199
199
|
|
|
@@ -221,9 +221,9 @@ The options to process the request using.
|
|
|
221
221
|
|
|
222
222
|
> `protected` **doCount**(`options`): `Promise`\<[`HttpResponse`](../interfaces/HttpResponse.md)\>
|
|
223
223
|
|
|
224
|
-
Defined in: [src/routes/ModelRoute.ts:
|
|
224
|
+
Defined in: [src/routes/ModelRoute.ts:187](https://github.com/rapidrest/service-core/blob/33d3655fa6883713f33f0fe6f330eb205671fea1/src/routes/ModelRoute.ts#L187)
|
|
225
225
|
|
|
226
|
-
Attempts to retrieve the number of data model objects matching the given set of criteria as specified in the
|
|
226
|
+
Attempts to retrieve the number of data model objects matching the given set of criteria as specified in the
|
|
227
227
|
request `query`. Any results that have been found are set to the `content-length` header of the `res` argument.
|
|
228
228
|
|
|
229
229
|
#### Parameters
|
|
@@ -244,10 +244,10 @@ The options to process the request using.
|
|
|
244
244
|
|
|
245
245
|
> `protected` **doCreate**(`obj`, `options`): `Promise`\<`T` \| `T`[]\>
|
|
246
246
|
|
|
247
|
-
Defined in: [src/routes/ModelRoute.ts:
|
|
247
|
+
Defined in: [src/routes/ModelRoute.ts:283](https://github.com/rapidrest/service-core/blob/33d3655fa6883713f33f0fe6f330eb205671fea1/src/routes/ModelRoute.ts#L283)
|
|
248
248
|
|
|
249
|
-
Attempts to store one or more objects provided in `options.req.body` into the datastore. Upon success, sets the newly persisted
|
|
250
|
-
object(s) to the `result` property of the `options.res` argument, otherwise sends a `400 BAD REQUEST` response to the
|
|
249
|
+
Attempts to store one or more objects provided in `options.req.body` into the datastore. Upon success, sets the newly persisted
|
|
250
|
+
object(s) to the `result` property of the `options.res` argument, otherwise sends a `400 BAD REQUEST` response to the
|
|
251
251
|
client.
|
|
252
252
|
|
|
253
253
|
#### Parameters
|
|
@@ -274,10 +274,10 @@ The options to process the request using.
|
|
|
274
274
|
|
|
275
275
|
> `protected` **doCreateObject**(`obj`, `options`): `Promise`\<`T`\>
|
|
276
276
|
|
|
277
|
-
Defined in: [src/routes/ModelRoute.ts:
|
|
277
|
+
Defined in: [src/routes/ModelRoute.ts:223](https://github.com/rapidrest/service-core/blob/33d3655fa6883713f33f0fe6f330eb205671fea1/src/routes/ModelRoute.ts#L223)
|
|
278
278
|
|
|
279
|
-
Attempts to store an object provided in `options.req.body` into the datastore. Upon success, sets the newly persisted
|
|
280
|
-
object(s) to the `result` property of the `options.res` argument, otherwise sends a `400 BAD REQUEST` response to the
|
|
279
|
+
Attempts to store an object provided in `options.req.body` into the datastore. Upon success, sets the newly persisted
|
|
280
|
+
object(s) to the `result` property of the `options.res` argument, otherwise sends a `400 BAD REQUEST` response to the
|
|
281
281
|
client.
|
|
282
282
|
|
|
283
283
|
#### Parameters
|
|
@@ -304,9 +304,9 @@ The options to process the request using.
|
|
|
304
304
|
|
|
305
305
|
> `protected` **doDelete**(`id`, `options`): `Promise`\<`void`\>
|
|
306
306
|
|
|
307
|
-
Defined in: [src/routes/ModelRoute.ts:
|
|
307
|
+
Defined in: [src/routes/ModelRoute.ts:311](https://github.com/rapidrest/service-core/blob/33d3655fa6883713f33f0fe6f330eb205671fea1/src/routes/ModelRoute.ts#L311)
|
|
308
308
|
|
|
309
|
-
Attempts to delete an existing data model object with a given unique identifier encoded by the URI parameter
|
|
309
|
+
Attempts to delete an existing data model object with a given unique identifier encoded by the URI parameter
|
|
310
310
|
`id`.
|
|
311
311
|
|
|
312
312
|
#### Parameters
|
|
@@ -333,7 +333,7 @@ The options to process the request using.
|
|
|
333
333
|
|
|
334
334
|
> `protected` **doExists**(`id`, `options`): `Promise`\<`any`\>
|
|
335
335
|
|
|
336
|
-
Defined in: [src/routes/ModelRoute.ts:
|
|
336
|
+
Defined in: [src/routes/ModelRoute.ts:356](https://github.com/rapidrest/service-core/blob/33d3655fa6883713f33f0fe6f330eb205671fea1/src/routes/ModelRoute.ts#L356)
|
|
337
337
|
|
|
338
338
|
Attempts to determine if an existing object with the given unique identifier exists.
|
|
339
339
|
|
|
@@ -361,10 +361,10 @@ The options to process the request using.
|
|
|
361
361
|
|
|
362
362
|
> `protected` **doFindAll**(`options`): `Promise`\<`T`[]\>
|
|
363
363
|
|
|
364
|
-
Defined in: [src/routes/ModelRoute.ts:
|
|
364
|
+
Defined in: [src/routes/ModelRoute.ts:397](https://github.com/rapidrest/service-core/blob/33d3655fa6883713f33f0fe6f330eb205671fea1/src/routes/ModelRoute.ts#L397)
|
|
365
365
|
|
|
366
|
-
Attempts to retrieve all data model objects matching the given set of criteria as specified in the request
|
|
367
|
-
`query`. Any results that have been found are set to the `result` property of the `res` argument. `result` is
|
|
366
|
+
Attempts to retrieve all data model objects matching the given set of criteria as specified in the request
|
|
367
|
+
`query`. Any results that have been found are set to the `result` property of the `res` argument. `result` is
|
|
368
368
|
never null.
|
|
369
369
|
|
|
370
370
|
#### Parameters
|
|
@@ -385,7 +385,7 @@ The options to process the request using.
|
|
|
385
385
|
|
|
386
386
|
> `protected` **doFindById**(`id`, `options`): `Promise`\<`T` \| `null`\>
|
|
387
387
|
|
|
388
|
-
Defined in: [src/routes/ModelRoute.ts:
|
|
388
|
+
Defined in: [src/routes/ModelRoute.ts:431](https://github.com/rapidrest/service-core/blob/33d3655fa6883713f33f0fe6f330eb205671fea1/src/routes/ModelRoute.ts#L431)
|
|
389
389
|
|
|
390
390
|
Attempts to retrieve a single data model object as identified by the `id` parameter in the URI.
|
|
391
391
|
|
|
@@ -411,9 +411,9 @@ The options to process the request using.
|
|
|
411
411
|
|
|
412
412
|
> `protected` **doTruncate**(`options`): `Promise`\<`void`\>
|
|
413
413
|
|
|
414
|
-
Defined in: [src/routes/ModelRoute.ts:
|
|
414
|
+
Defined in: [src/routes/ModelRoute.ts:472](https://github.com/rapidrest/service-core/blob/33d3655fa6883713f33f0fe6f330eb205671fea1/src/routes/ModelRoute.ts#L472)
|
|
415
415
|
|
|
416
|
-
Attempts to remove all entries of the data model type from the datastore matching the given
|
|
416
|
+
Attempts to remove all entries of the data model type from the datastore matching the given
|
|
417
417
|
parameters and query.
|
|
418
418
|
|
|
419
419
|
#### Parameters
|
|
@@ -434,7 +434,7 @@ The options to process the request using.
|
|
|
434
434
|
|
|
435
435
|
> `protected` **doUpdate**(`id`, `obj`, `options`): `Promise`\<`T`\>
|
|
436
436
|
|
|
437
|
-
Defined in: [src/routes/ModelRoute.ts:
|
|
437
|
+
Defined in: [src/routes/ModelRoute.ts:539](https://github.com/rapidrest/service-core/blob/33d3655fa6883713f33f0fe6f330eb205671fea1/src/routes/ModelRoute.ts#L539)
|
|
438
438
|
|
|
439
439
|
Attempts to modify an existing data model object as identified by the `id` parameter in the URI.
|
|
440
440
|
|
|
@@ -466,7 +466,7 @@ The options to process the request using.
|
|
|
466
466
|
|
|
467
467
|
> `protected` **doUpdateProperty**(`id`, `propertyName`, `value`, `options`): `Promise`\<`T`\>
|
|
468
468
|
|
|
469
|
-
Defined in: [src/routes/ModelRoute.ts:
|
|
469
|
+
Defined in: [src/routes/ModelRoute.ts:589](https://github.com/rapidrest/service-core/blob/33d3655fa6883713f33f0fe6f330eb205671fea1/src/routes/ModelRoute.ts#L589)
|
|
470
470
|
|
|
471
471
|
Attempts to modify a single property of an existing data model object as identified by the `id` parameter in the URI.
|
|
472
472
|
|
|
@@ -508,7 +508,7 @@ The options to process the request using.
|
|
|
508
508
|
|
|
509
509
|
> `protected` **doValidate**(`objs`, `options?`): `Promise`\<`void`\>
|
|
510
510
|
|
|
511
|
-
Defined in: [src/routes/ModelRoute.ts:
|
|
511
|
+
Defined in: [src/routes/ModelRoute.ts:630](https://github.com/rapidrest/service-core/blob/33d3655fa6883713f33f0fe6f330eb205671fea1/src/routes/ModelRoute.ts#L630)
|
|
512
512
|
|
|
513
513
|
Calls `repoUtils.validate()` to validate the object(s) provided.
|
|
514
514
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: ModelUtils
|
|
8
8
|
|
|
9
|
-
Defined in: [src/models/ModelUtils.ts:24](https://github.com/rapidrest/service-core/blob/
|
|
9
|
+
Defined in: [src/models/ModelUtils.ts:24](https://github.com/rapidrest/service-core/blob/33d3655fa6883713f33f0fe6f330eb205671fea1/src/models/ModelUtils.ts#L24)
|
|
10
10
|
|
|
11
11
|
Utility class for working with data model classes.
|
|
12
12
|
|
|
@@ -28,9 +28,9 @@ Jean-Philippe Steinmetz
|
|
|
28
28
|
|
|
29
29
|
### buildIdSearchQuery()
|
|
30
30
|
|
|
31
|
-
> `static` **buildIdSearchQuery**\<`T`\>(`repo`, `modelClass`, `id`, `version
|
|
31
|
+
> `static` **buildIdSearchQuery**\<`T`\>(`repo`, `modelClass`, `id`, `version?`): `any`
|
|
32
32
|
|
|
33
|
-
Defined in: [src/models/ModelUtils.ts:
|
|
33
|
+
Defined in: [src/models/ModelUtils.ts:87](https://github.com/rapidrest/service-core/blob/33d3655fa6883713f33f0fe6f330eb205671fea1/src/models/ModelUtils.ts#L87)
|
|
34
34
|
|
|
35
35
|
Builds a query object for use with `find` functions of the given repository for retrieving objects matching the
|
|
36
36
|
specified unique identifier.
|
|
@@ -67,12 +67,6 @@ The unique identifier to search for.
|
|
|
67
67
|
|
|
68
68
|
The version number of the document to search for.
|
|
69
69
|
|
|
70
|
-
##### productUid?
|
|
71
|
-
|
|
72
|
-
`string`
|
|
73
|
-
|
|
74
|
-
The optional product uid that is associated with the uid (when a compound key is used).
|
|
75
|
-
|
|
76
70
|
#### Returns
|
|
77
71
|
|
|
78
72
|
`any`
|
|
@@ -83,9 +77,9 @@ An object that can be passed to a TypeORM `find` function.
|
|
|
83
77
|
|
|
84
78
|
### buildIdSearchQueryMongo()
|
|
85
79
|
|
|
86
|
-
> `static` **buildIdSearchQueryMongo**(`modelClass`, `id`, `version
|
|
80
|
+
> `static` **buildIdSearchQueryMongo**(`modelClass`, `id`, `version?`): `any`
|
|
87
81
|
|
|
88
|
-
Defined in: [src/models/ModelUtils.ts:
|
|
82
|
+
Defined in: [src/models/ModelUtils.ts:135](https://github.com/rapidrest/service-core/blob/33d3655fa6883713f33f0fe6f330eb205671fea1/src/models/ModelUtils.ts#L135)
|
|
89
83
|
|
|
90
84
|
Builds a MongoDB compatible query object for use in `find` functions for retrieving objects matching the
|
|
91
85
|
specified unique identifier.
|
|
@@ -110,12 +104,6 @@ The unique identifier to search for.
|
|
|
110
104
|
|
|
111
105
|
The version number of the document to search for.
|
|
112
106
|
|
|
113
|
-
##### productUid?
|
|
114
|
-
|
|
115
|
-
`string`
|
|
116
|
-
|
|
117
|
-
The optional product uid that is associated with the uid (when a compound key is used).
|
|
118
|
-
|
|
119
107
|
#### Returns
|
|
120
108
|
|
|
121
109
|
`any`
|
|
@@ -126,9 +114,9 @@ An object that can be passed to a MongoDB `find` function.
|
|
|
126
114
|
|
|
127
115
|
### buildIdSearchQuerySQL()
|
|
128
116
|
|
|
129
|
-
> `static` **buildIdSearchQuerySQL**(`modelClass`, `id`, `version
|
|
117
|
+
> `static` **buildIdSearchQuerySQL**(`modelClass`, `id`, `version?`): `any`
|
|
130
118
|
|
|
131
|
-
Defined in: [src/models/ModelUtils.ts:
|
|
119
|
+
Defined in: [src/models/ModelUtils.ts:109](https://github.com/rapidrest/service-core/blob/33d3655fa6883713f33f0fe6f330eb205671fea1/src/models/ModelUtils.ts#L109)
|
|
132
120
|
|
|
133
121
|
Builds a TypeORM compatible query object for use in `find` functions for retrieving objects matching the
|
|
134
122
|
specified unique identifier.
|
|
@@ -153,12 +141,6 @@ The unique identifier to search for.
|
|
|
153
141
|
|
|
154
142
|
The version number of the document to search for.
|
|
155
143
|
|
|
156
|
-
##### productUid?
|
|
157
|
-
|
|
158
|
-
`string`
|
|
159
|
-
|
|
160
|
-
The optional product uid that is associated with the uid (when a compound key is used).
|
|
161
|
-
|
|
162
144
|
#### Returns
|
|
163
145
|
|
|
164
146
|
`any`
|
|
@@ -171,7 +153,7 @@ An object that can be passed to a TypeORM `find` function.
|
|
|
171
153
|
|
|
172
154
|
> `static` **buildSearchQuery**\<`T`\>(`modelClass`, `repo`, `params?`, `queryParams?`, `exactMatch?`, `user?`): `any`
|
|
173
155
|
|
|
174
|
-
Defined in: [src/models/ModelUtils.ts:
|
|
156
|
+
Defined in: [src/models/ModelUtils.ts:362](https://github.com/rapidrest/service-core/blob/33d3655fa6883713f33f0fe6f330eb205671fea1/src/models/ModelUtils.ts#L362)
|
|
175
157
|
|
|
176
158
|
Builds a query object for the given criteria and repository. Query params can have a value containing a
|
|
177
159
|
conditional operator to apply for the search. The operator is encoded with the format `op(value)`. The following
|
|
@@ -246,7 +228,7 @@ The TypeORM compatible query object.
|
|
|
246
228
|
|
|
247
229
|
> `static` **buildSearchQueryMongo**(`modelClass`, `params?`, `queryParams?`, `exactMatch?`, `user?`): `any`
|
|
248
230
|
|
|
249
|
-
Defined in: [src/models/ModelUtils.ts:
|
|
231
|
+
Defined in: [src/models/ModelUtils.ts:552](https://github.com/rapidrest/service-core/blob/33d3655fa6883713f33f0fe6f330eb205671fea1/src/models/ModelUtils.ts#L552)
|
|
250
232
|
|
|
251
233
|
Builds a MongoDB compatible query object for the given criteria. Query params can have a value containing a
|
|
252
234
|
conditional operator to apply for the search. The operator is encoded with the format `op(value)`. The following
|
|
@@ -309,7 +291,7 @@ The TypeORM compatible query object.
|
|
|
309
291
|
|
|
310
292
|
> `static` **buildSearchQuerySQL**(`modelClass`, `params?`, `queryParams?`, `exactMatch?`, `user?`): `any`
|
|
311
293
|
|
|
312
|
-
Defined in: [src/models/ModelUtils.ts:
|
|
294
|
+
Defined in: [src/models/ModelUtils.ts:408](https://github.com/rapidrest/service-core/blob/33d3655fa6883713f33f0fe6f330eb205671fea1/src/models/ModelUtils.ts#L408)
|
|
313
295
|
|
|
314
296
|
Builds a TypeORM compatible query object for the given criteria. Query params can have a value containing a
|
|
315
297
|
conditional operator to apply for the search. The operator is encoded with the format `op(value)`. The following
|
|
@@ -370,7 +352,7 @@ The TypeORM compatible query object.
|
|
|
370
352
|
|
|
371
353
|
> `static` **getIdPropertyNames**(`modelClass`): `string`[]
|
|
372
354
|
|
|
373
|
-
Defined in: [src/models/ModelUtils.ts:56](https://github.com/rapidrest/service-core/blob/
|
|
355
|
+
Defined in: [src/models/ModelUtils.ts:56](https://github.com/rapidrest/service-core/blob/33d3655fa6883713f33f0fe6f330eb205671fea1/src/models/ModelUtils.ts#L56)
|
|
374
356
|
|
|
375
357
|
Retrieves a list of all of the specified class's properties that have the
|
|
376
358
|
|
|
@@ -402,7 +384,7 @@ decorator applied.
|
|
|
402
384
|
|
|
403
385
|
> `static` **loadModels**(`src`, `result?`): `Promise`\<`Map`\<`string`, `any`\>\>
|
|
404
386
|
|
|
405
|
-
Defined in: [src/models/ModelUtils.ts:
|
|
387
|
+
Defined in: [src/models/ModelUtils.ts:704](https://github.com/rapidrest/service-core/blob/33d3655fa6883713f33f0fe6f330eb205671fea1/src/models/ModelUtils.ts#L704)
|
|
406
388
|
|
|
407
389
|
Loads all model schema files from the specified path and returns a map containing all the definitions.
|
|
408
390
|
|
|
@@ -430,7 +412,7 @@ A map containing of all loaded model names to their class definitions.
|
|
|
430
412
|
|
|
431
413
|
> `static` **setTypeOrm**(`module`): `void`
|
|
432
414
|
|
|
433
|
-
Defined in: [src/models/ModelUtils.ts:34](https://github.com/rapidrest/service-core/blob/
|
|
415
|
+
Defined in: [src/models/ModelUtils.ts:34](https://github.com/rapidrest/service-core/blob/33d3655fa6883713f33f0fe6f330eb205671fea1/src/models/ModelUtils.ts#L34)
|
|
434
416
|
|
|
435
417
|
Provides the `typeorm` module to use when building SQL queries. This is called automatically when a SQL
|
|
436
418
|
datastore connection is established.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: MongoConnection
|
|
8
8
|
|
|
9
|
-
Defined in: [src/database/MongoConnection.ts:17](https://github.com/rapidrest/service-core/blob/
|
|
9
|
+
Defined in: [src/database/MongoConnection.ts:17](https://github.com/rapidrest/service-core/blob/33d3655fa6883713f33f0fe6f330eb205671fea1/src/database/MongoConnection.ts#L17)
|
|
10
10
|
|
|
11
11
|
Represents a single named connection to a MongoDB database using the native `mongodb` driver, including the
|
|
12
12
|
registry of all model classes assigned to the connection's datastore.
|
|
@@ -24,7 +24,7 @@ Jean-Philippe Steinmetz <rapidrests@gmail.com>
|
|
|
24
24
|
|
|
25
25
|
> **new MongoConnection**(`name`, `client`, `db`, `entities?`): `MongoConnection`
|
|
26
26
|
|
|
27
|
-
Defined in: [src/database/MongoConnection.ts:29](https://github.com/rapidrest/service-core/blob/
|
|
27
|
+
Defined in: [src/database/MongoConnection.ts:29](https://github.com/rapidrest/service-core/blob/33d3655fa6883713f33f0fe6f330eb205671fea1/src/database/MongoConnection.ts#L29)
|
|
28
28
|
|
|
29
29
|
#### Parameters
|
|
30
30
|
|
|
@@ -54,7 +54,7 @@ Defined in: [src/database/MongoConnection.ts:29](https://github.com/rapidrest/se
|
|
|
54
54
|
|
|
55
55
|
> `readonly` **client**: `MongoClient`
|
|
56
56
|
|
|
57
|
-
Defined in: [src/database/MongoConnection.ts:19](https://github.com/rapidrest/service-core/blob/
|
|
57
|
+
Defined in: [src/database/MongoConnection.ts:19](https://github.com/rapidrest/service-core/blob/33d3655fa6883713f33f0fe6f330eb205671fea1/src/database/MongoConnection.ts#L19)
|
|
58
58
|
|
|
59
59
|
The underlying MongoDB client.
|
|
60
60
|
|
|
@@ -64,7 +64,7 @@ The underlying MongoDB client.
|
|
|
64
64
|
|
|
65
65
|
> `readonly` **db**: `Db`
|
|
66
66
|
|
|
67
|
-
Defined in: [src/database/MongoConnection.ts:21](https://github.com/rapidrest/service-core/blob/
|
|
67
|
+
Defined in: [src/database/MongoConnection.ts:21](https://github.com/rapidrest/service-core/blob/33d3655fa6883713f33f0fe6f330eb205671fea1/src/database/MongoConnection.ts#L21)
|
|
68
68
|
|
|
69
69
|
The database that this connection is bound to.
|
|
70
70
|
|
|
@@ -74,7 +74,7 @@ The database that this connection is bound to.
|
|
|
74
74
|
|
|
75
75
|
> `readonly` **name**: `string`
|
|
76
76
|
|
|
77
|
-
Defined in: [src/database/MongoConnection.ts:23](https://github.com/rapidrest/service-core/blob/
|
|
77
|
+
Defined in: [src/database/MongoConnection.ts:23](https://github.com/rapidrest/service-core/blob/33d3655fa6883713f33f0fe6f330eb205671fea1/src/database/MongoConnection.ts#L23)
|
|
78
78
|
|
|
79
79
|
The name of the datastore that this connection was created for.
|
|
80
80
|
|
|
@@ -86,7 +86,7 @@ The name of the datastore that this connection was created for.
|
|
|
86
86
|
|
|
87
87
|
> **get** **entityClasses**(): `any`[]
|
|
88
88
|
|
|
89
|
-
Defined in: [src/database/MongoConnection.ts:71](https://github.com/rapidrest/service-core/blob/
|
|
89
|
+
Defined in: [src/database/MongoConnection.ts:71](https://github.com/rapidrest/service-core/blob/33d3655fa6883713f33f0fe6f330eb205671fea1/src/database/MongoConnection.ts#L71)
|
|
90
90
|
|
|
91
91
|
Returns the list of all model classes registered with this connection.
|
|
92
92
|
|
|
@@ -102,7 +102,7 @@ Returns the list of all model classes registered with this connection.
|
|
|
102
102
|
|
|
103
103
|
> **get** **isConnected**(): `boolean`
|
|
104
104
|
|
|
105
|
-
Defined in: [src/database/MongoConnection.ts:42](https://github.com/rapidrest/service-core/blob/
|
|
105
|
+
Defined in: [src/database/MongoConnection.ts:42](https://github.com/rapidrest/service-core/blob/33d3655fa6883713f33f0fe6f330eb205671fea1/src/database/MongoConnection.ts#L42)
|
|
106
106
|
|
|
107
107
|
Indicates whether or not the connection is currently active.
|
|
108
108
|
|
|
@@ -116,7 +116,7 @@ Indicates whether or not the connection is currently active.
|
|
|
116
116
|
|
|
117
117
|
> **admin**(): `Admin`
|
|
118
118
|
|
|
119
|
-
Defined in: [src/database/MongoConnection.ts:47](https://github.com/rapidrest/service-core/blob/
|
|
119
|
+
Defined in: [src/database/MongoConnection.ts:47](https://github.com/rapidrest/service-core/blob/33d3655fa6883713f33f0fe6f330eb205671fea1/src/database/MongoConnection.ts#L47)
|
|
120
120
|
|
|
121
121
|
Returns the admin interface of the underlying database.
|
|
122
122
|
|
|
@@ -130,7 +130,7 @@ Returns the admin interface of the underlying database.
|
|
|
130
130
|
|
|
131
131
|
> **close**(): `Promise`\<`void`\>
|
|
132
132
|
|
|
133
|
-
Defined in: [src/database/MongoConnection.ts:54](https://github.com/rapidrest/service-core/blob/
|
|
133
|
+
Defined in: [src/database/MongoConnection.ts:54](https://github.com/rapidrest/service-core/blob/33d3655fa6883713f33f0fe6f330eb205671fea1/src/database/MongoConnection.ts#L54)
|
|
134
134
|
|
|
135
135
|
Closes the connection to the database server.
|
|
136
136
|
|
|
@@ -144,7 +144,7 @@ Closes the connection to the database server.
|
|
|
144
144
|
|
|
145
145
|
> **collectionNameFor**(`clazz`): `string`
|
|
146
146
|
|
|
147
|
-
Defined in: [src/database/MongoConnection.ts:64](https://github.com/rapidrest/service-core/blob/
|
|
147
|
+
Defined in: [src/database/MongoConnection.ts:64](https://github.com/rapidrest/service-core/blob/33d3655fa6883713f33f0fe6f330eb205671fea1/src/database/MongoConnection.ts#L64)
|
|
148
148
|
|
|
149
149
|
Returns the name of the collection that records of the given model class are stored in.
|
|
150
150
|
|
|
@@ -166,7 +166,7 @@ The model class to resolve the collection name for.
|
|
|
166
166
|
|
|
167
167
|
> **getMongoRepository**\<`T`\>(`classOrName`): [`MongoRepository`](MongoRepository.md)\<`T`\>
|
|
168
168
|
|
|
169
|
-
Defined in: [src/database/MongoConnection.ts:105](https://github.com/rapidrest/service-core/blob/
|
|
169
|
+
Defined in: [src/database/MongoConnection.ts:105](https://github.com/rapidrest/service-core/blob/33d3655fa6883713f33f0fe6f330eb205671fea1/src/database/MongoConnection.ts#L105)
|
|
170
170
|
|
|
171
171
|
Returns a repository for performing operations against the collection associated with the given model class.
|
|
172
172
|
This is an alias of `getRepository` provided for compatibility with TypeORM's `DataSource` interface.
|
|
@@ -195,7 +195,7 @@ The model class, or the name of a registered model class, to retrieve a reposito
|
|
|
195
195
|
|
|
196
196
|
> **getRepository**\<`T`\>(`classOrName`): [`MongoRepository`](MongoRepository.md)\<`T`\>
|
|
197
197
|
|
|
198
|
-
Defined in: [src/database/MongoConnection.ts:80](https://github.com/rapidrest/service-core/blob/
|
|
198
|
+
Defined in: [src/database/MongoConnection.ts:80](https://github.com/rapidrest/service-core/blob/33d3655fa6883713f33f0fe6f330eb205671fea1/src/database/MongoConnection.ts#L80)
|
|
199
199
|
|
|
200
200
|
Returns a repository for performing operations against the collection associated with the given model class.
|
|
201
201
|
|