@sfxcode/nuxt-mongocamp-server 1.6.3 → 1.8.0
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/README.md +8 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/api/.openapi-generator/FILES +30 -0
- package/dist/runtime/api/apis/AdminApi.d.ts +1 -1
- package/dist/runtime/api/apis/ApplicationApi.d.ts +1 -1
- package/dist/runtime/api/apis/AuthApi.d.ts +19 -2
- package/dist/runtime/api/apis/AuthApi.js +48 -0
- package/dist/runtime/api/apis/BucketApi.d.ts +1 -1
- package/dist/runtime/api/apis/CollectionApi.d.ts +78 -4
- package/dist/runtime/api/apis/CollectionApi.js +236 -2
- package/dist/runtime/api/apis/DatabaseApi.d.ts +1 -1
- package/dist/runtime/api/apis/DocumentApi.d.ts +92 -2
- package/dist/runtime/api/apis/DocumentApi.js +275 -0
- package/dist/runtime/api/apis/FileApi.d.ts +1 -1
- package/dist/runtime/api/apis/IndexApi.d.ts +36 -2
- package/dist/runtime/api/apis/IndexApi.js +104 -0
- package/dist/runtime/api/apis/JobsApi.d.ts +1 -1
- package/dist/runtime/api/apis/SystemApi.d.ts +1 -1
- package/dist/runtime/api/docs/AuthApi.md +78 -0
- package/dist/runtime/api/docs/CollectionApi.md +335 -2
- package/dist/runtime/api/docs/CollectionPermission.md +40 -0
- package/dist/runtime/api/docs/CollectionSummary.md +50 -0
- package/dist/runtime/api/docs/CopyRequest.md +40 -0
- package/dist/runtime/api/docs/CopyResponse.md +38 -0
- package/dist/runtime/api/docs/CountResponse.md +34 -0
- package/dist/runtime/api/docs/DocumentApi.md +377 -8
- package/dist/runtime/api/docs/FieldInfo.md +36 -0
- package/dist/runtime/api/docs/FieldTypeCount.md +36 -0
- package/dist/runtime/api/docs/ImportResponse.md +42 -0
- package/dist/runtime/api/docs/IndexApi.md +156 -0
- package/dist/runtime/api/docs/IndexCreateRequest.md +2 -0
- package/dist/runtime/api/docs/IndexInfo.md +54 -0
- package/dist/runtime/api/docs/IndexKey.md +36 -0
- package/dist/runtime/api/docs/IndexOptionsRequest.md +10 -0
- package/dist/runtime/api/docs/IndexUsage.md +40 -0
- package/dist/runtime/api/docs/InsertError.md +38 -0
- package/dist/runtime/api/docs/InsertResponse.md +4 -0
- package/dist/runtime/api/docs/RenameRequest.md +36 -0
- package/dist/runtime/api/docs/RenameResponse.md +34 -0
- package/dist/runtime/api/docs/SearchRequest.md +38 -0
- package/dist/runtime/api/models/BucketInformation.d.ts +1 -1
- package/dist/runtime/api/models/ClusterInformation.d.ts +1 -1
- package/dist/runtime/api/models/ClusterMemberInformation.d.ts +1 -1
- package/dist/runtime/api/models/CollectionPermission.d.ts +50 -0
- package/dist/runtime/api/models/CollectionPermission.js +35 -0
- package/dist/runtime/api/models/CollectionStatus.d.ts +1 -1
- package/dist/runtime/api/models/CollectionSummary.d.ts +80 -0
- package/dist/runtime/api/models/CollectionSummary.js +50 -0
- package/dist/runtime/api/models/CopyRequest.d.ts +50 -0
- package/dist/runtime/api/models/CopyRequest.js +32 -0
- package/dist/runtime/api/models/CopyResponse.d.ts +44 -0
- package/dist/runtime/api/models/CopyResponse.js +32 -0
- package/dist/runtime/api/models/CountResponse.d.ts +32 -0
- package/dist/runtime/api/models/CountResponse.js +26 -0
- package/dist/runtime/api/models/DatabaseInfo.d.ts +1 -1
- package/dist/runtime/api/models/DeleteResponse.d.ts +1 -1
- package/dist/runtime/api/models/ErrorDescription.d.ts +1 -1
- package/dist/runtime/api/models/FieldInfo.d.ts +39 -0
- package/dist/runtime/api/models/FieldInfo.js +32 -0
- package/dist/runtime/api/models/FieldTypeCount.d.ts +38 -0
- package/dist/runtime/api/models/FieldTypeCount.js +29 -0
- package/dist/runtime/api/models/FileInformation.d.ts +1 -1
- package/dist/runtime/api/models/Grant.d.ts +1 -1
- package/dist/runtime/api/models/ImportResponse.d.ts +57 -0
- package/dist/runtime/api/models/ImportResponse.js +41 -0
- package/dist/runtime/api/models/IndexCreateRequest.d.ts +9 -2
- package/dist/runtime/api/models/IndexCreateRequest.js +9 -4
- package/dist/runtime/api/models/IndexCreateResponse.d.ts +1 -1
- package/dist/runtime/api/models/IndexDropResponse.d.ts +1 -1
- package/dist/runtime/api/models/IndexInfo.d.ts +99 -0
- package/dist/runtime/api/models/IndexInfo.js +54 -0
- package/dist/runtime/api/models/IndexKey.d.ts +38 -0
- package/dist/runtime/api/models/IndexKey.js +29 -0
- package/dist/runtime/api/models/IndexOptionsRequest.d.ts +37 -1
- package/dist/runtime/api/models/IndexOptionsRequest.js +12 -2
- package/dist/runtime/api/models/IndexUsage.d.ts +52 -0
- package/dist/runtime/api/models/IndexUsage.js +35 -0
- package/dist/runtime/api/models/InsertError.d.ts +44 -0
- package/dist/runtime/api/models/InsertError.js +32 -0
- package/dist/runtime/api/models/InsertResponse.d.ts +14 -1
- package/dist/runtime/api/models/InsertResponse.js +10 -2
- package/dist/runtime/api/models/JobConfig.d.ts +1 -1
- package/dist/runtime/api/models/JobInformation.d.ts +1 -1
- package/dist/runtime/api/models/JsonSchema.d.ts +1 -1
- package/dist/runtime/api/models/JsonSchemaDefinition.d.ts +1 -1
- package/dist/runtime/api/models/JsonValueAny.d.ts +1 -1
- package/dist/runtime/api/models/JsonValueBoolean.d.ts +1 -1
- package/dist/runtime/api/models/JsonValueString.d.ts +1 -1
- package/dist/runtime/api/models/Login.d.ts +1 -1
- package/dist/runtime/api/models/LoginResult.d.ts +1 -1
- package/dist/runtime/api/models/MongoAggregateRequest.d.ts +1 -1
- package/dist/runtime/api/models/MongoCampConfiguration.d.ts +1 -1
- package/dist/runtime/api/models/MongoFindRequest.d.ts +1 -1
- package/dist/runtime/api/models/MongoIndex.d.ts +1 -1
- package/dist/runtime/api/models/PasswordUpdateRequest.d.ts +1 -1
- package/dist/runtime/api/models/PipelineStage.d.ts +1 -1
- package/dist/runtime/api/models/RenameRequest.d.ts +38 -0
- package/dist/runtime/api/models/RenameRequest.js +28 -0
- package/dist/runtime/api/models/RenameResponse.d.ts +32 -0
- package/dist/runtime/api/models/RenameResponse.js +26 -0
- package/dist/runtime/api/models/Role.d.ts +1 -1
- package/dist/runtime/api/models/SchemaAnalysis.d.ts +1 -1
- package/dist/runtime/api/models/SchemaAnalysisField.d.ts +1 -1
- package/dist/runtime/api/models/SchemaAnalysisFieldType.d.ts +1 -1
- package/dist/runtime/api/models/SearchRequest.d.ts +44 -0
- package/dist/runtime/api/models/SearchRequest.js +29 -0
- package/dist/runtime/api/models/SettingsResponse.d.ts +1 -1
- package/dist/runtime/api/models/UpdateFileInformationRequest.d.ts +1 -1
- package/dist/runtime/api/models/UpdateRequest.d.ts +1 -1
- package/dist/runtime/api/models/UpdateResponse.d.ts +1 -1
- package/dist/runtime/api/models/UpdateRoleRequest.d.ts +1 -1
- package/dist/runtime/api/models/UserInformation.d.ts +1 -1
- package/dist/runtime/api/models/UserProfile.d.ts +1 -1
- package/dist/runtime/api/models/Version.d.ts +1 -1
- package/dist/runtime/api/models/index.d.ts +15 -0
- package/dist/runtime/api/models/index.js +15 -0
- package/dist/runtime/api/runtime.d.ts +1 -1
- package/package.json +8 -8
|
@@ -6,24 +6,28 @@ All URIs are relative to *http://localhost*
|
|
|
6
6
|
|------------- | ------------- | -------------|
|
|
7
7
|
| [**aggregate**](CollectionApi.md#aggregate) | **POST** /mongodb/collections/{collectionName}/aggregate | Aggregate in Collection |
|
|
8
8
|
| [**clearCollection**](CollectionApi.md#clearcollection) | **DELETE** /mongodb/collections/{collectionName}/clear | Clear Collection |
|
|
9
|
+
| [**copyCollection**](CollectionApi.md#copycollection) | **POST** /mongodb/collections/{collectionName}/copy | Copy Collection |
|
|
9
10
|
| [**deleteCollection**](CollectionApi.md#deletecollection) | **DELETE** /mongodb/collections/{collectionName} | Delete Collection |
|
|
10
11
|
| [**distinct**](CollectionApi.md#distinct) | **POST** /mongodb/collections/{collectionName}/distinct/{field} | Distinct in Collection |
|
|
11
12
|
| [**getCollectionFields**](CollectionApi.md#getcollectionfields) | **GET** /mongodb/collections/{collectionName}/fields | Collection Fields |
|
|
12
13
|
| [**getCollectionInformation**](CollectionApi.md#getcollectioninformation) | **GET** /mongodb/collections/{collectionName} | Collection Information |
|
|
14
|
+
| [**getFieldDetails**](CollectionApi.md#getfielddetails) | **GET** /mongodb/collections/{collectionName}/fields/detail | Fields of a Collection with types |
|
|
13
15
|
| [**getJsonSchema**](CollectionApi.md#getjsonschema) | **GET** /mongodb/collections/{collectionName}/schema | Collection Fields |
|
|
14
16
|
| [**getSchemaAnalysis**](CollectionApi.md#getschemaanalysis) | **GET** /mongodb/collections/{collectionName}/schema/analysis | Collection Fields |
|
|
17
|
+
| [**listCollectionInformation**](CollectionApi.md#listcollectioninformation) | **GET** /mongodb/collections/info | Information of all Collections |
|
|
15
18
|
| [**listCollections**](CollectionApi.md#listcollections) | **GET** /mongodb/collections | List of Collections |
|
|
16
19
|
| [**listCollectionsByDatabase**](CollectionApi.md#listcollectionsbydatabase) | **GET** /mongodb/databases/{databaseName}/collections | List of Collections |
|
|
20
|
+
| [**renameCollection**](CollectionApi.md#renamecollection) | **POST** /mongodb/collections/{collectionName}/rename | Rename Collection |
|
|
17
21
|
|
|
18
22
|
|
|
19
23
|
|
|
20
24
|
## aggregate
|
|
21
25
|
|
|
22
|
-
> Array<{ [key: string]: any; }> aggregate(collectionName, mongoAggregateRequest, rowsPerPage, page)
|
|
26
|
+
> Array<{ [key: string]: any; }> aggregate(collectionName, mongoAggregateRequest, rowsPerPage, page, filter, extendedJson)
|
|
23
27
|
|
|
24
28
|
Aggregate in Collection
|
|
25
29
|
|
|
26
|
-
Aggregate in a given Collection. The value of a stage is any JSON value. Operators that run JavaScript on the database server or write to collections (`$function`, `$accumulator`, `$where`, `$out`, `$merge`, `$currentOp`, `$listSessions` by default, configured with AGGREGATION_STAGES_DENIED) are refused with 403.
|
|
30
|
+
Aggregate in a given Collection. The value of a stage is any JSON value. Operators that run JavaScript on the database server or write to collections (`$function`, `$accumulator`, `$where`, `$out`, `$merge`, `$currentOp`, `$listSessions`, `$collStats`, `$indexStats` by default, configured with AGGREGATION_STAGES_DENIED) are refused with 403.
|
|
27
31
|
|
|
28
32
|
### Example
|
|
29
33
|
|
|
@@ -56,6 +60,10 @@ async function example() {
|
|
|
56
60
|
rowsPerPage: 100,
|
|
57
61
|
// number | Requested page of the ResultSets (optional)
|
|
58
62
|
page: 1,
|
|
63
|
+
// string | Filter Query like on the list of documents, applied as the first stage of the pipeline. Not possible for a pipeline that starts with $geoNear, $search or $vectorSearch. (optional)
|
|
64
|
+
filter: filter_example,
|
|
65
|
+
// string | relaxed or canonical: the documents with the types of their values as MongoDB Extended JSON ({\"$oid\": ...}, {\"$date\": ...}, {\"$numberDecimal\": ...}, canonical also {\"$numberInt\": ...}, {\"$numberLong\": ...} and {\"$numberDouble\": ...}). Without the parameter the documents are returned as before. (optional)
|
|
66
|
+
extendedJson: extendedJson_example,
|
|
59
67
|
} satisfies AggregateRequest;
|
|
60
68
|
|
|
61
69
|
try {
|
|
@@ -79,6 +87,8 @@ example().catch(console.error);
|
|
|
79
87
|
| **mongoAggregateRequest** | [MongoAggregateRequest](MongoAggregateRequest.md) | | |
|
|
80
88
|
| **rowsPerPage** | `number` | Count elements per page | [Optional] [Defaults to `undefined`] |
|
|
81
89
|
| **page** | `number` | Requested page of the ResultSets | [Optional] [Defaults to `undefined`] |
|
|
90
|
+
| **filter** | `string` | Filter Query like on the list of documents, applied as the first stage of the pipeline. Not possible for a pipeline that starts with $geoNear, $search or $vectorSearch. | [Optional] [Defaults to `undefined`] |
|
|
91
|
+
| **extendedJson** | `string` | relaxed or canonical: the documents with the types of their values as MongoDB Extended JSON ({\"$oid\": ...}, {\"$date\": ...}, {\"$numberDecimal\": ...}, canonical also {\"$numberInt\": ...}, {\"$numberLong\": ...} and {\"$numberDouble\": ...}). Without the parameter the documents are returned as before. | [Optional] [Defaults to `undefined`] |
|
|
82
92
|
|
|
83
93
|
### Return type
|
|
84
94
|
|
|
@@ -181,6 +191,87 @@ example().catch(console.error);
|
|
|
181
191
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
182
192
|
|
|
183
193
|
|
|
194
|
+
## copyCollection
|
|
195
|
+
|
|
196
|
+
> CopyResponse copyCollection(collectionName, copyRequest)
|
|
197
|
+
|
|
198
|
+
Copy Collection
|
|
199
|
+
|
|
200
|
+
Copy a Collection in the database, optionally only the documents that match a Lucene filter, with its indices (withIndexes, true by default). The target is a name in the database of the Collection. The read grant for the Collection and the write grant for the target are needed. An existing target is a conflict (409), unless dropTarget is true and the user has the administrate grant for it: it is replaced when the copy is complete. The copy is made in one request, a big collection takes its time.
|
|
201
|
+
|
|
202
|
+
### Example
|
|
203
|
+
|
|
204
|
+
```ts
|
|
205
|
+
import {
|
|
206
|
+
Configuration,
|
|
207
|
+
CollectionApi,
|
|
208
|
+
} from '';
|
|
209
|
+
import type { CopyCollectionRequest } from '';
|
|
210
|
+
|
|
211
|
+
async function example() {
|
|
212
|
+
console.log("🚀 Testing SDK...");
|
|
213
|
+
const config = new Configuration({
|
|
214
|
+
// To configure HTTP basic authorization: httpAuth1
|
|
215
|
+
username: "YOUR USERNAME",
|
|
216
|
+
password: "YOUR PASSWORD",
|
|
217
|
+
// Configure HTTP bearer authorization: httpAuth
|
|
218
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
219
|
+
// To configure API key authorization: apiKeyAuth
|
|
220
|
+
apiKey: "YOUR API KEY",
|
|
221
|
+
});
|
|
222
|
+
const api = new CollectionApi(config);
|
|
223
|
+
|
|
224
|
+
const body = {
|
|
225
|
+
// string | The name of your MongoDb Collection
|
|
226
|
+
collectionName: collectionName_example,
|
|
227
|
+
// CopyRequest
|
|
228
|
+
copyRequest: {"target":"copyOfCollection","filter":"type:company","withIndexes":true,"dropTarget":false},
|
|
229
|
+
} satisfies CopyCollectionRequest;
|
|
230
|
+
|
|
231
|
+
try {
|
|
232
|
+
const data = await api.copyCollection(body);
|
|
233
|
+
console.log(data);
|
|
234
|
+
} catch (error) {
|
|
235
|
+
console.error(error);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
// Run the test
|
|
240
|
+
example().catch(console.error);
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
### Parameters
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
| Name | Type | Description | Notes |
|
|
247
|
+
|------------- | ------------- | ------------- | -------------|
|
|
248
|
+
| **collectionName** | `string` | The name of your MongoDb Collection | [Defaults to `undefined`] |
|
|
249
|
+
| **copyRequest** | [CopyRequest](CopyRequest.md) | | |
|
|
250
|
+
|
|
251
|
+
### Return type
|
|
252
|
+
|
|
253
|
+
[**CopyResponse**](CopyResponse.md)
|
|
254
|
+
|
|
255
|
+
### Authorization
|
|
256
|
+
|
|
257
|
+
[httpAuth1](../README.md#httpAuth1), [httpAuth](../README.md#httpAuth), [apiKeyAuth](../README.md#apiKeyAuth)
|
|
258
|
+
|
|
259
|
+
### HTTP request headers
|
|
260
|
+
|
|
261
|
+
- **Content-Type**: `application/json`
|
|
262
|
+
- **Accept**: `application/json`, `text/plain`
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
### HTTP response details
|
|
266
|
+
| Status code | Description | Response headers |
|
|
267
|
+
|-------------|-------------|------------------|
|
|
268
|
+
| **200** | | - |
|
|
269
|
+
| **400** | Invalid value for: body | - |
|
|
270
|
+
| **0** | | * x-error-code - Error Code <br> * x-error-message - Message of the MongoCampException <br> * x-error-additional-info - Additional information for the MongoCampException <br> |
|
|
271
|
+
|
|
272
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
273
|
+
|
|
274
|
+
|
|
184
275
|
## deleteCollection
|
|
185
276
|
|
|
186
277
|
> JsonValueBoolean deleteCollection(collectionName)
|
|
@@ -507,6 +598,90 @@ example().catch(console.error);
|
|
|
507
598
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
508
599
|
|
|
509
600
|
|
|
601
|
+
## getFieldDetails
|
|
602
|
+
|
|
603
|
+
> Array<FieldInfo> getFieldDetails(collectionName, sampleSize, depth)
|
|
604
|
+
|
|
605
|
+
Fields of a Collection with types
|
|
606
|
+
|
|
607
|
+
All fields of a collection as a flat list, one entry per path (`address.city`, `tags[]` for the elements of an array) with the types of the values and how often every type was found in the analysed documents.
|
|
608
|
+
|
|
609
|
+
### Example
|
|
610
|
+
|
|
611
|
+
```ts
|
|
612
|
+
import {
|
|
613
|
+
Configuration,
|
|
614
|
+
CollectionApi,
|
|
615
|
+
} from '';
|
|
616
|
+
import type { GetFieldDetailsRequest } from '';
|
|
617
|
+
|
|
618
|
+
async function example() {
|
|
619
|
+
console.log("🚀 Testing SDK...");
|
|
620
|
+
const config = new Configuration({
|
|
621
|
+
// To configure HTTP basic authorization: httpAuth1
|
|
622
|
+
username: "YOUR USERNAME",
|
|
623
|
+
password: "YOUR PASSWORD",
|
|
624
|
+
// Configure HTTP bearer authorization: httpAuth
|
|
625
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
626
|
+
// To configure API key authorization: apiKeyAuth
|
|
627
|
+
apiKey: "YOUR API KEY",
|
|
628
|
+
});
|
|
629
|
+
const api = new CollectionApi(config);
|
|
630
|
+
|
|
631
|
+
const body = {
|
|
632
|
+
// string | The name of your MongoDb Collection
|
|
633
|
+
collectionName: collectionName_example,
|
|
634
|
+
// number | Number of documents that are analysed, 1000 by default. A greater sample is more exact and slower on big collections. (optional)
|
|
635
|
+
sampleSize: 1000,
|
|
636
|
+
// number | How deep should the objects extracted (optional)
|
|
637
|
+
depth: 56,
|
|
638
|
+
} satisfies GetFieldDetailsRequest;
|
|
639
|
+
|
|
640
|
+
try {
|
|
641
|
+
const data = await api.getFieldDetails(body);
|
|
642
|
+
console.log(data);
|
|
643
|
+
} catch (error) {
|
|
644
|
+
console.error(error);
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
// Run the test
|
|
649
|
+
example().catch(console.error);
|
|
650
|
+
```
|
|
651
|
+
|
|
652
|
+
### Parameters
|
|
653
|
+
|
|
654
|
+
|
|
655
|
+
| Name | Type | Description | Notes |
|
|
656
|
+
|------------- | ------------- | ------------- | -------------|
|
|
657
|
+
| **collectionName** | `string` | The name of your MongoDb Collection | [Defaults to `undefined`] |
|
|
658
|
+
| **sampleSize** | `number` | Number of documents that are analysed, 1000 by default. A greater sample is more exact and slower on big collections. | [Optional] [Defaults to `1000`] |
|
|
659
|
+
| **depth** | `number` | How deep should the objects extracted | [Optional] [Defaults to `3`] |
|
|
660
|
+
|
|
661
|
+
### Return type
|
|
662
|
+
|
|
663
|
+
[**Array<FieldInfo>**](FieldInfo.md)
|
|
664
|
+
|
|
665
|
+
### Authorization
|
|
666
|
+
|
|
667
|
+
[httpAuth1](../README.md#httpAuth1), [httpAuth](../README.md#httpAuth), [apiKeyAuth](../README.md#apiKeyAuth)
|
|
668
|
+
|
|
669
|
+
### HTTP request headers
|
|
670
|
+
|
|
671
|
+
- **Content-Type**: Not defined
|
|
672
|
+
- **Accept**: `application/json`, `text/plain`
|
|
673
|
+
|
|
674
|
+
|
|
675
|
+
### HTTP response details
|
|
676
|
+
| Status code | Description | Response headers |
|
|
677
|
+
|-------------|-------------|------------------|
|
|
678
|
+
| **200** | | - |
|
|
679
|
+
| **400** | Invalid value for: query parameter sampleSize, Invalid value for: query parameter depth | - |
|
|
680
|
+
| **0** | | * x-error-code - Error Code <br> * x-error-message - Message of the MongoCampException <br> * x-error-additional-info - Additional information for the MongoCampException <br> |
|
|
681
|
+
|
|
682
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
683
|
+
|
|
684
|
+
|
|
510
685
|
## getJsonSchema
|
|
511
686
|
|
|
512
687
|
> JsonSchema getJsonSchema(collectionName, sampleSize, deepth)
|
|
@@ -675,6 +850,83 @@ example().catch(console.error);
|
|
|
675
850
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
676
851
|
|
|
677
852
|
|
|
853
|
+
## listCollectionInformation
|
|
854
|
+
|
|
855
|
+
> Array<CollectionSummary> listCollectionInformation(name)
|
|
856
|
+
|
|
857
|
+
Information of all Collections
|
|
858
|
+
|
|
859
|
+
The numbers of all Collections of the default database that the user may read in one request (count, size, storage size, average size of a document, number and size of the indices). A Collection without statistics, for example a view, is listed with available false.
|
|
860
|
+
|
|
861
|
+
### Example
|
|
862
|
+
|
|
863
|
+
```ts
|
|
864
|
+
import {
|
|
865
|
+
Configuration,
|
|
866
|
+
CollectionApi,
|
|
867
|
+
} from '';
|
|
868
|
+
import type { ListCollectionInformationRequest } from '';
|
|
869
|
+
|
|
870
|
+
async function example() {
|
|
871
|
+
console.log("🚀 Testing SDK...");
|
|
872
|
+
const config = new Configuration({
|
|
873
|
+
// To configure HTTP basic authorization: httpAuth1
|
|
874
|
+
username: "YOUR USERNAME",
|
|
875
|
+
password: "YOUR PASSWORD",
|
|
876
|
+
// Configure HTTP bearer authorization: httpAuth
|
|
877
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
878
|
+
// To configure API key authorization: apiKeyAuth
|
|
879
|
+
apiKey: "YOUR API KEY",
|
|
880
|
+
});
|
|
881
|
+
const api = new CollectionApi(config);
|
|
882
|
+
|
|
883
|
+
const body = {
|
|
884
|
+
// Array<string> | Only the Collections with these names, by default all Collections that the user may read (optional)
|
|
885
|
+
name: ...,
|
|
886
|
+
} satisfies ListCollectionInformationRequest;
|
|
887
|
+
|
|
888
|
+
try {
|
|
889
|
+
const data = await api.listCollectionInformation(body);
|
|
890
|
+
console.log(data);
|
|
891
|
+
} catch (error) {
|
|
892
|
+
console.error(error);
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
// Run the test
|
|
897
|
+
example().catch(console.error);
|
|
898
|
+
```
|
|
899
|
+
|
|
900
|
+
### Parameters
|
|
901
|
+
|
|
902
|
+
|
|
903
|
+
| Name | Type | Description | Notes |
|
|
904
|
+
|------------- | ------------- | ------------- | -------------|
|
|
905
|
+
| **name** | `Array<string>` | Only the Collections with these names, by default all Collections that the user may read | [Optional] |
|
|
906
|
+
|
|
907
|
+
### Return type
|
|
908
|
+
|
|
909
|
+
[**Array<CollectionSummary>**](CollectionSummary.md)
|
|
910
|
+
|
|
911
|
+
### Authorization
|
|
912
|
+
|
|
913
|
+
[httpAuth1](../README.md#httpAuth1), [httpAuth](../README.md#httpAuth), [apiKeyAuth](../README.md#apiKeyAuth)
|
|
914
|
+
|
|
915
|
+
### HTTP request headers
|
|
916
|
+
|
|
917
|
+
- **Content-Type**: Not defined
|
|
918
|
+
- **Accept**: `application/json`
|
|
919
|
+
|
|
920
|
+
|
|
921
|
+
### HTTP response details
|
|
922
|
+
| Status code | Description | Response headers |
|
|
923
|
+
|-------------|-------------|------------------|
|
|
924
|
+
| **200** | | - |
|
|
925
|
+
| **0** | | * x-error-code - Error Code <br> * x-error-message - Message of the MongoCampException <br> * x-error-additional-info - Additional information for the MongoCampException <br> |
|
|
926
|
+
|
|
927
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
928
|
+
|
|
929
|
+
|
|
678
930
|
## listCollections
|
|
679
931
|
|
|
680
932
|
> Array<string> listCollections()
|
|
@@ -820,3 +1072,84 @@ example().catch(console.error);
|
|
|
820
1072
|
|
|
821
1073
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
822
1074
|
|
|
1075
|
+
|
|
1076
|
+
## renameCollection
|
|
1077
|
+
|
|
1078
|
+
> RenameResponse renameCollection(collectionName, renameRequest)
|
|
1079
|
+
|
|
1080
|
+
Rename Collection
|
|
1081
|
+
|
|
1082
|
+
Rename a Collection in the database, with its Documents and Indices. The target is a name in the database of the Collection. The administrate grant for the Collection and the write grant for the target are needed. An existing target is a conflict (409), unless dropTarget is true and the user has the administrate grant for it: it is replaced then.
|
|
1083
|
+
|
|
1084
|
+
### Example
|
|
1085
|
+
|
|
1086
|
+
```ts
|
|
1087
|
+
import {
|
|
1088
|
+
Configuration,
|
|
1089
|
+
CollectionApi,
|
|
1090
|
+
} from '';
|
|
1091
|
+
import type { RenameCollectionRequest } from '';
|
|
1092
|
+
|
|
1093
|
+
async function example() {
|
|
1094
|
+
console.log("🚀 Testing SDK...");
|
|
1095
|
+
const config = new Configuration({
|
|
1096
|
+
// To configure HTTP basic authorization: httpAuth1
|
|
1097
|
+
username: "YOUR USERNAME",
|
|
1098
|
+
password: "YOUR PASSWORD",
|
|
1099
|
+
// Configure HTTP bearer authorization: httpAuth
|
|
1100
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
1101
|
+
// To configure API key authorization: apiKeyAuth
|
|
1102
|
+
apiKey: "YOUR API KEY",
|
|
1103
|
+
});
|
|
1104
|
+
const api = new CollectionApi(config);
|
|
1105
|
+
|
|
1106
|
+
const body = {
|
|
1107
|
+
// string | The name of your MongoDb Collection
|
|
1108
|
+
collectionName: collectionName_example,
|
|
1109
|
+
// RenameRequest
|
|
1110
|
+
renameRequest: {"target":"newName","dropTarget":false},
|
|
1111
|
+
} satisfies RenameCollectionRequest;
|
|
1112
|
+
|
|
1113
|
+
try {
|
|
1114
|
+
const data = await api.renameCollection(body);
|
|
1115
|
+
console.log(data);
|
|
1116
|
+
} catch (error) {
|
|
1117
|
+
console.error(error);
|
|
1118
|
+
}
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1121
|
+
// Run the test
|
|
1122
|
+
example().catch(console.error);
|
|
1123
|
+
```
|
|
1124
|
+
|
|
1125
|
+
### Parameters
|
|
1126
|
+
|
|
1127
|
+
|
|
1128
|
+
| Name | Type | Description | Notes |
|
|
1129
|
+
|------------- | ------------- | ------------- | -------------|
|
|
1130
|
+
| **collectionName** | `string` | The name of your MongoDb Collection | [Defaults to `undefined`] |
|
|
1131
|
+
| **renameRequest** | [RenameRequest](RenameRequest.md) | | |
|
|
1132
|
+
|
|
1133
|
+
### Return type
|
|
1134
|
+
|
|
1135
|
+
[**RenameResponse**](RenameResponse.md)
|
|
1136
|
+
|
|
1137
|
+
### Authorization
|
|
1138
|
+
|
|
1139
|
+
[httpAuth1](../README.md#httpAuth1), [httpAuth](../README.md#httpAuth), [apiKeyAuth](../README.md#apiKeyAuth)
|
|
1140
|
+
|
|
1141
|
+
### HTTP request headers
|
|
1142
|
+
|
|
1143
|
+
- **Content-Type**: `application/json`
|
|
1144
|
+
- **Accept**: `application/json`, `text/plain`
|
|
1145
|
+
|
|
1146
|
+
|
|
1147
|
+
### HTTP response details
|
|
1148
|
+
| Status code | Description | Response headers |
|
|
1149
|
+
|-------------|-------------|------------------|
|
|
1150
|
+
| **200** | | - |
|
|
1151
|
+
| **400** | Invalid value for: body | - |
|
|
1152
|
+
| **0** | | * x-error-code - Error Code <br> * x-error-message - Message of the MongoCampException <br> * x-error-additional-info - Additional information for the MongoCampException <br> |
|
|
1153
|
+
|
|
1154
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
1155
|
+
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
|
|
2
|
+
# CollectionPermission
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`name` | string
|
|
10
|
+
`read` | boolean
|
|
11
|
+
`write` | boolean
|
|
12
|
+
`administrate` | boolean
|
|
13
|
+
|
|
14
|
+
## Example
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
import type { CollectionPermission } from ''
|
|
18
|
+
|
|
19
|
+
// TODO: Update the object below with actual values
|
|
20
|
+
const example = {
|
|
21
|
+
"name": null,
|
|
22
|
+
"read": null,
|
|
23
|
+
"write": null,
|
|
24
|
+
"administrate": null,
|
|
25
|
+
} satisfies CollectionPermission
|
|
26
|
+
|
|
27
|
+
console.log(example)
|
|
28
|
+
|
|
29
|
+
// Convert the instance to a JSON string
|
|
30
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
31
|
+
console.log(exampleJSON)
|
|
32
|
+
|
|
33
|
+
// Parse the JSON string back to an object
|
|
34
|
+
const exampleParsed = JSON.parse(exampleJSON) as CollectionPermission
|
|
35
|
+
console.log(exampleParsed)
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
39
|
+
|
|
40
|
+
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
|
|
2
|
+
# CollectionSummary
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`name` | string
|
|
10
|
+
`collectionType` | string
|
|
11
|
+
`count` | number
|
|
12
|
+
`size` | number
|
|
13
|
+
`storageSize` | number
|
|
14
|
+
`avgObjSize` | number
|
|
15
|
+
`nindexes` | number
|
|
16
|
+
`totalIndexSize` | number
|
|
17
|
+
`available` | boolean
|
|
18
|
+
|
|
19
|
+
## Example
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
import type { CollectionSummary } from ''
|
|
23
|
+
|
|
24
|
+
// TODO: Update the object below with actual values
|
|
25
|
+
const example = {
|
|
26
|
+
"name": null,
|
|
27
|
+
"collectionType": null,
|
|
28
|
+
"count": null,
|
|
29
|
+
"size": null,
|
|
30
|
+
"storageSize": null,
|
|
31
|
+
"avgObjSize": null,
|
|
32
|
+
"nindexes": null,
|
|
33
|
+
"totalIndexSize": null,
|
|
34
|
+
"available": null,
|
|
35
|
+
} satisfies CollectionSummary
|
|
36
|
+
|
|
37
|
+
console.log(example)
|
|
38
|
+
|
|
39
|
+
// Convert the instance to a JSON string
|
|
40
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
41
|
+
console.log(exampleJSON)
|
|
42
|
+
|
|
43
|
+
// Parse the JSON string back to an object
|
|
44
|
+
const exampleParsed = JSON.parse(exampleJSON) as CollectionSummary
|
|
45
|
+
console.log(exampleParsed)
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
49
|
+
|
|
50
|
+
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
|
|
2
|
+
# CopyRequest
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`target` | string
|
|
10
|
+
`filter` | string
|
|
11
|
+
`withIndexes` | boolean
|
|
12
|
+
`dropTarget` | boolean
|
|
13
|
+
|
|
14
|
+
## Example
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
import type { CopyRequest } from ''
|
|
18
|
+
|
|
19
|
+
// TODO: Update the object below with actual values
|
|
20
|
+
const example = {
|
|
21
|
+
"target": null,
|
|
22
|
+
"filter": null,
|
|
23
|
+
"withIndexes": null,
|
|
24
|
+
"dropTarget": null,
|
|
25
|
+
} satisfies CopyRequest
|
|
26
|
+
|
|
27
|
+
console.log(example)
|
|
28
|
+
|
|
29
|
+
// Convert the instance to a JSON string
|
|
30
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
31
|
+
console.log(exampleJSON)
|
|
32
|
+
|
|
33
|
+
// Parse the JSON string back to an object
|
|
34
|
+
const exampleParsed = JSON.parse(exampleJSON) as CopyRequest
|
|
35
|
+
console.log(exampleParsed)
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
39
|
+
|
|
40
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
|
|
2
|
+
# CopyResponse
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`name` | string
|
|
10
|
+
`count` | number
|
|
11
|
+
`indexes` | number
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import type { CopyResponse } from ''
|
|
17
|
+
|
|
18
|
+
// TODO: Update the object below with actual values
|
|
19
|
+
const example = {
|
|
20
|
+
"name": null,
|
|
21
|
+
"count": null,
|
|
22
|
+
"indexes": null,
|
|
23
|
+
} satisfies CopyResponse
|
|
24
|
+
|
|
25
|
+
console.log(example)
|
|
26
|
+
|
|
27
|
+
// Convert the instance to a JSON string
|
|
28
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
29
|
+
console.log(exampleJSON)
|
|
30
|
+
|
|
31
|
+
// Parse the JSON string back to an object
|
|
32
|
+
const exampleParsed = JSON.parse(exampleJSON) as CopyResponse
|
|
33
|
+
console.log(exampleParsed)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
37
|
+
|
|
38
|
+
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
|
|
2
|
+
# CountResponse
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`count` | number
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import type { CountResponse } from ''
|
|
15
|
+
|
|
16
|
+
// TODO: Update the object below with actual values
|
|
17
|
+
const example = {
|
|
18
|
+
"count": null,
|
|
19
|
+
} satisfies CountResponse
|
|
20
|
+
|
|
21
|
+
console.log(example)
|
|
22
|
+
|
|
23
|
+
// Convert the instance to a JSON string
|
|
24
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
25
|
+
console.log(exampleJSON)
|
|
26
|
+
|
|
27
|
+
// Parse the JSON string back to an object
|
|
28
|
+
const exampleParsed = JSON.parse(exampleJSON) as CountResponse
|
|
29
|
+
console.log(exampleParsed)
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
33
|
+
|
|
34
|
+
|