mongodb-atlas-api-client 2.24.0 → 2.25.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 +95 -0
- package/package.json +2 -2
- package/src/atlasSearch.d.ts +17 -0
- package/src/atlasSearch.js +81 -0
- package/src/index.d.ts +3 -0
- package/src/index.js +3 -0
- package/test/atlasSearch.test.js +106 -0
package/README.md
CHANGED
|
@@ -64,6 +64,7 @@ Following entities are currently supported
|
|
|
64
64
|
- [Event](#event)
|
|
65
65
|
- [Alert](#alert)
|
|
66
66
|
- [DataLake](#datalake)
|
|
67
|
+
- [AtlasSearch](#atlassearch)
|
|
67
68
|
|
|
68
69
|
### User
|
|
69
70
|
|
|
@@ -857,4 +858,98 @@ Function - Deletes the cloudProviderAccess name passed.
|
|
|
857
858
|
|
|
858
859
|
More details - https://docs.atlas.mongodb.com/reference/api/cloud-provider-access-deauthorize-one-role/
|
|
859
860
|
|
|
861
|
+
### AtlasSearch
|
|
862
|
+
|
|
863
|
+
### atlasSearch.get(clusterName, indexId, [options]) ⇒ <code>Promise</code>
|
|
864
|
+
Function - Returns the details of atlas search index by cluster name and index passed.
|
|
865
|
+
|
|
866
|
+
**Returns**: <code>Promise</code> - - promise which resolves on success and rejects on error
|
|
867
|
+
|
|
868
|
+
| Param | Type | Default | Description |
|
|
869
|
+
| --- | --- | --- | --- |
|
|
870
|
+
| clusterName | <code>String</code> | | name of the cluster for which details needs to be retrieved |
|
|
871
|
+
| indexId | <code>String</code> | | id of the index for which details needs to be retrieved |
|
|
872
|
+
| [options] | <code>Object</code> | <code>{}</code> | Optional object containing extra query strings which will be passed to atlas api |
|
|
873
|
+
|
|
874
|
+
More details - https://docs.atlas.mongodb.com/reference/api/fts-indexes-get-one/
|
|
875
|
+
|
|
876
|
+
### atlasSearch.getAll(clusterName, databaseName, collectionName, [options]) ⇒ <code>Promise</code>
|
|
877
|
+
Function - Returns all the atlas search indexes. Pagination can be controlled via options object.
|
|
878
|
+
|
|
879
|
+
**Returns**: <code>Promise</code> - - promise which resolves on success and rejects on error
|
|
880
|
+
|
|
881
|
+
| Param | Type | Default | Description |
|
|
882
|
+
| --- | --- | --- | --- |
|
|
883
|
+
| clusterName | <code>String</code> | | name of the cluster for which details needs to be retrieved |
|
|
884
|
+
| databaseName | <code>String</code> | | name of the database for which details needs to be retrieved |
|
|
885
|
+
| collectionName | <code>String</code> | | name of the collection for which details needs to be retrieved |
|
|
886
|
+
| [options] | <code>Object</code> | <code>{}</code> | Optional object containing extra query strings which will be passed to atlas api |
|
|
887
|
+
|
|
888
|
+
More details - https://docs.atlas.mongodb.com/reference/api/fts-indexes-get-all/
|
|
889
|
+
|
|
890
|
+
### atlasSearch.getAllAnalyzers(clusterName, [options]) ⇒ <code>Promise</code>
|
|
891
|
+
Function - Returns all the Analyzers. Pagination can be controlled via options object.
|
|
892
|
+
|
|
893
|
+
**Returns**: <code>Promise</code> - - promise which resolves on success and rejects on error
|
|
894
|
+
|
|
895
|
+
| Param | Type | Default | Description |
|
|
896
|
+
| --- | --- | --- | --- |
|
|
897
|
+
| clusterName | <code>String</code> | | name of the cluster for which details needs to be retrieved |
|
|
898
|
+
| [options] | <code>Object</code> | <code>{}</code> | Optional object containing extra query strings which will be passed to atlas api |
|
|
899
|
+
|
|
900
|
+
More details - https://docs.atlas.mongodb.com/reference/api/fts-analyzers-get-all/
|
|
901
|
+
|
|
902
|
+
### atlasSearch.create(clusterName, body, [options]) ⇒ <code>Promise</code>
|
|
903
|
+
Function - Creates the atlas search index as per body passed.
|
|
904
|
+
|
|
905
|
+
**Returns**: <code>Promise</code> - - promise which resolves on success and rejects on error
|
|
906
|
+
|
|
907
|
+
| Param | Type | Default | Description |
|
|
908
|
+
| --- | --- | --- | --- |
|
|
909
|
+
| clusterName | <code>String</code> | | name of the cluster for which details needs to be retrieved |
|
|
910
|
+
| body | <code>Object</code> | | Body which has details for cluster which needs to be created |
|
|
911
|
+
| [options] | <code>Object</code> | <code>{}</code> | Optional object containing extra query strings which will be passed to atlas api |
|
|
912
|
+
|
|
913
|
+
More details - https://docs.atlas.mongodb.com/reference/api/fts-indexes-create-one/
|
|
914
|
+
|
|
915
|
+
### atlasSearch.update(clusterName, indexId, body, [options]) ⇒ <code>Promise</code>
|
|
916
|
+
Function - Updates the atlas search index for the clusterName passed. It only updates the properties passed in body.
|
|
917
|
+
|
|
918
|
+
**Returns**: <code>Promise</code> - - promise which resolves on success and rejects on error
|
|
919
|
+
|
|
920
|
+
| Param | Type | Default | Description |
|
|
921
|
+
| --- | --- | --- | --- |
|
|
922
|
+
| clusterName | <code>String</code> | | name of the cluster for which details needs to be updated |
|
|
923
|
+
| indexId | <code>String</code> | | name of the index for which details needs to be updated |
|
|
924
|
+
| body | <code>Object</code> | | Body which has details for cluster which needs to be updated |
|
|
925
|
+
| [options] | <code>Object</code> | <code>{}</code> | Optional object containing extra query strings which will be passed to atlas api |
|
|
926
|
+
|
|
927
|
+
More details - https://docs.atlas.mongodb.com/reference/api/fts-indexes-update-one/
|
|
928
|
+
|
|
929
|
+
### atlasSearch.upsertAnalyzer(clusterName, body, [options]) ⇒ <code>Promise</code>
|
|
930
|
+
Function - Upserts the analyser for the clusterName passed.
|
|
931
|
+
|
|
932
|
+
**Returns**: <code>Promise</code> - - promise which resolves on success and rejects on error
|
|
933
|
+
|
|
934
|
+
| Param | Type | Default | Description |
|
|
935
|
+
| --- | --- | --- | --- |
|
|
936
|
+
| clusterName | <code>String</code> | | name of the cluster for which details needs to be upserted |
|
|
937
|
+
| body | <code>Object</code> | | Body which has details for cluster which needs to be upserted |
|
|
938
|
+
| [options] | <code>Object</code> | <code>{}</code> | Optional object containing extra query strings which will be passed to atlas api |
|
|
939
|
+
|
|
940
|
+
More details - https://docs.atlas.mongodb.com/reference/api/fts-analyzers-update-all/
|
|
941
|
+
|
|
942
|
+
### atlasSearch.delete(clusterName, indexId, [options]) ⇒ <code>Promise</code>
|
|
943
|
+
Function - Deletes the atlas search index by cluster name passed.
|
|
944
|
+
|
|
945
|
+
**Returns**: <code>Promise</code> - - promise which resolves on success and rejects on error
|
|
946
|
+
|
|
947
|
+
| Param | Type | Default | Description |
|
|
948
|
+
| --- | --- | --- | --- |
|
|
949
|
+
| clusterName | <code>String</code> | | name of the cluster which needs to be deleted |
|
|
950
|
+
| indexId | <code>String</code> | | name of the index for which details needs to be deleted |
|
|
951
|
+
| [options] | <code>Object</code> | <code>{}</code> | Optional object containing extra query strings which will be passed to atlas api |
|
|
952
|
+
|
|
953
|
+
More details - https://docs.atlas.mongodb.com/reference/api/fts-indexes-delete-one/
|
|
954
|
+
|
|
860
955
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mongodb-atlas-api-client",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.25.0",
|
|
4
4
|
"description": "A mongodb atlas api client for nodejs.",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"digest-fetch": "^1.1.6",
|
|
52
|
-
"node-fetch": "^2.6.
|
|
52
|
+
"node-fetch": "^2.6.5",
|
|
53
53
|
"qs": "^6.9.6"
|
|
54
54
|
}
|
|
55
55
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {AtlasClientOptions, AtlasError} from '.';
|
|
2
|
+
|
|
3
|
+
// DataLakeClient
|
|
4
|
+
export type ClusterName = string;
|
|
5
|
+
export type IndexId = string;
|
|
6
|
+
export type DatabaseName = string;
|
|
7
|
+
export type CollectionName = string;
|
|
8
|
+
|
|
9
|
+
export interface AtlasSearch {
|
|
10
|
+
get(clusterName: ClusterName, indexId: IndexId, options?: AtlasClientOptions): Promise<any | AtlasError>;
|
|
11
|
+
getAll(clusterName: ClusterName, databaseName: DatabaseName, collectionName: CollectionName, options?: AtlasClientOptions): Promise<any | AtlasError>;
|
|
12
|
+
delete(clusterName: ClusterName, indexId: IndexId, options?: AtlasClientOptions): Promise<any | AtlasError>;
|
|
13
|
+
update(clusterName: ClusterName, indexId: IndexId, body: object, options?: AtlasClientOptions): Promise<any | AtlasError>;
|
|
14
|
+
create(clusterName: ClusterName, body: object, options?: AtlasClientOptions): Promise<any | AtlasError>;
|
|
15
|
+
getAllAnalyzers(clusterName: ClusterName, options?: AtlasClientOptions): Promise<any | AtlasError>;
|
|
16
|
+
upsertAnalyzer(clusterName: ClusterName, body: object, options?: AtlasClientOptions): Promise<any | AtlasError>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
const qs = require("qs");
|
|
2
|
+
|
|
3
|
+
class AtlasSearch {
|
|
4
|
+
|
|
5
|
+
constructor(client, baseUrl, projectId) {
|
|
6
|
+
this.client_ = client;
|
|
7
|
+
this.baseUrl_ = baseUrl;
|
|
8
|
+
this.projectId_ = projectId;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
async get(clusterName, indexId, options) {
|
|
12
|
+
const queryString = qs.stringify(options);
|
|
13
|
+
const response = (
|
|
14
|
+
await this.client_.fetch(`${this.baseUrl_}/groups/${this.projectId_}/clusters/${clusterName}/fts/indexes/${indexId}?${queryString}`)
|
|
15
|
+
).json();
|
|
16
|
+
return response;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
async getAllAnalyzers(clusterName, options) {
|
|
20
|
+
const queryString = qs.stringify(options);
|
|
21
|
+
const response = (
|
|
22
|
+
await this.client_.fetch(`${this.baseUrl_}/groups/${this.projectId_}/clusters/${clusterName}/fts/analyzers?${queryString}`)
|
|
23
|
+
).json();
|
|
24
|
+
return response;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
async upsertAnalyzer(clusterName, body, options) {
|
|
28
|
+
const queryString = qs.stringify(options);
|
|
29
|
+
const response = (
|
|
30
|
+
await this.client_.fetch(`${this.baseUrl_}/groups/${this.projectId_}/clusters/${clusterName}/fts/analyzers?${queryString}`, {
|
|
31
|
+
"method": "PUT",
|
|
32
|
+
"body": JSON.stringify(body),
|
|
33
|
+
"headers": {"Content-Type": "application/json"}
|
|
34
|
+
})
|
|
35
|
+
).json();
|
|
36
|
+
return response;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
async getAll(clusterName, databaseName, collectionName, options) {
|
|
40
|
+
const queryString = qs.stringify(options);
|
|
41
|
+
const response = (
|
|
42
|
+
await this.client_.fetch(`${this.baseUrl_}/groups/${this.projectId_}/clusters/${clusterName}/fts/indexes/${databaseName}/${collectionName}?${queryString}`)
|
|
43
|
+
).json();
|
|
44
|
+
return response;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
async delete(clusterName, indexId, options) {
|
|
48
|
+
const queryString = qs.stringify(options);
|
|
49
|
+
await this.client_.fetch(`${this.baseUrl_}/groups/${this.projectId_}/clusters/${clusterName}/fts/indexes/${indexId}?${queryString}`, {
|
|
50
|
+
"method": "DELETE"
|
|
51
|
+
});
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
async update(clusterName, indexId, body, options) {
|
|
56
|
+
const queryString = qs.stringify(options);
|
|
57
|
+
const response = (
|
|
58
|
+
await this.client_.fetch(`${this.baseUrl_}/groups/${this.projectId_}/clusters/${clusterName}/fts/indexes/${indexId}?${queryString}`, {
|
|
59
|
+
"method": "PATCH",
|
|
60
|
+
"body": JSON.stringify(body),
|
|
61
|
+
"headers": {"Content-Type": "application/json"}
|
|
62
|
+
})
|
|
63
|
+
).json();
|
|
64
|
+
return response;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
async create(clusterName, body, options) {
|
|
68
|
+
const queryString = qs.stringify(options);
|
|
69
|
+
const response = (
|
|
70
|
+
await this.client_.fetch(`${this.baseUrl_}/groups/${this.projectId_}/clusters/${clusterName}/fts/indexes?${queryString}`, {
|
|
71
|
+
"method": "POST",
|
|
72
|
+
"body": JSON.stringify(body),
|
|
73
|
+
"headers": {"Content-Type": "application/json"}
|
|
74
|
+
})
|
|
75
|
+
).json();
|
|
76
|
+
return response;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
module.exports = AtlasSearch;
|
|
81
|
+
|
package/src/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ import {ProjectAccesslist} from './projectAccesslist';
|
|
|
10
10
|
import {User} from './user';
|
|
11
11
|
import {DataLake} from './dataLake';
|
|
12
12
|
import {CloudProviderAccess} from './cloudProviderAccess';
|
|
13
|
+
import {AtlasSearch} from './atlasSearch';
|
|
13
14
|
|
|
14
15
|
export * from './alert'
|
|
15
16
|
export * from './atlasUser';
|
|
@@ -23,6 +24,7 @@ export * from './projectAccesslist';
|
|
|
23
24
|
export * from './user';
|
|
24
25
|
export * from './dataLake'
|
|
25
26
|
export * from './cloudProviderAccess';
|
|
27
|
+
export * from './atlasSearch';
|
|
26
28
|
|
|
27
29
|
export interface KeyValuePairDocument {
|
|
28
30
|
key: string;
|
|
@@ -67,6 +69,7 @@ export interface AtlasClient {
|
|
|
67
69
|
event: Event;
|
|
68
70
|
dataLake: DataLake;
|
|
69
71
|
cloudProviderAccess: CloudProviderAccess;
|
|
72
|
+
atlasSearch: AtlasSearch
|
|
70
73
|
}
|
|
71
74
|
|
|
72
75
|
export interface AtlasClientConfig {
|
package/src/index.js
CHANGED
|
@@ -10,6 +10,7 @@ const Event = require("./event");
|
|
|
10
10
|
const Alert = require("./alert");
|
|
11
11
|
const DataLake = require("./dataLake");
|
|
12
12
|
const CloudProviderAccess = require("./cloudProviderAccess");
|
|
13
|
+
const AtlasSearch = require("./atlasSearch");
|
|
13
14
|
const DigestFetch = require("digest-fetch");
|
|
14
15
|
|
|
15
16
|
function getFunctions(instance) {
|
|
@@ -40,6 +41,7 @@ function getMongodbAtlasApiClient(options) {
|
|
|
40
41
|
const alert = new Alert(client, options.baseUrl, options.projectId);
|
|
41
42
|
const dataLake = new DataLake(client, options.baseUrl, options.projectId);
|
|
42
43
|
const cloudProviderAccess = new CloudProviderAccess(client, options.baseUrl, options.projectId);
|
|
44
|
+
const atlasSearch = new AtlasSearch(client, options.baseUrl, options.projectId);
|
|
43
45
|
|
|
44
46
|
const functions = {};
|
|
45
47
|
functions.user = getFunctions(user);
|
|
@@ -54,6 +56,7 @@ function getMongodbAtlasApiClient(options) {
|
|
|
54
56
|
functions.alert = getFunctions(alert);
|
|
55
57
|
functions.dataLake = getFunctions(dataLake);
|
|
56
58
|
functions.cloudProviderAccess = getFunctions(cloudProviderAccess);
|
|
59
|
+
functions.atlasSearch = getFunctions(atlasSearch);
|
|
57
60
|
|
|
58
61
|
return functions;
|
|
59
62
|
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
const {describe, it} = exports.lab = require("@hapi/lab").script();
|
|
2
|
+
const {expect} = require("@hapi/code");
|
|
3
|
+
const nock = require("nock");
|
|
4
|
+
const getClient = require("../src");
|
|
5
|
+
|
|
6
|
+
const baseUrl = "http://dummyBaseUrl";
|
|
7
|
+
const projectId = "dummyProjectId";
|
|
8
|
+
|
|
9
|
+
const client = getClient({
|
|
10
|
+
"publicKey": "dummuyPublicKey",
|
|
11
|
+
"privateKey": "dummyPrivateKey",
|
|
12
|
+
"baseUrl": baseUrl,
|
|
13
|
+
"projectId": projectId
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
describe("Mongo Atlas Api Client - atlasSearch", () => {
|
|
17
|
+
|
|
18
|
+
describe("When atlasSearch is exported from index", () => {
|
|
19
|
+
it("should export atlasSearch functions", async () => {
|
|
20
|
+
expect(client.atlasSearch.get).to.be.function();
|
|
21
|
+
expect(client.atlasSearch.getAll).to.be.function();
|
|
22
|
+
expect(client.atlasSearch.create).to.be.function();
|
|
23
|
+
expect(client.atlasSearch.delete).to.be.function();
|
|
24
|
+
expect(client.atlasSearch.update).to.be.function();
|
|
25
|
+
expect(client.atlasSearch.getAllAnalyzers).to.be.function();
|
|
26
|
+
expect(client.atlasSearch.upsertAnalyzer).to.be.function();
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
describe("When get is called with querystring parameters", () => {
|
|
31
|
+
it("should return response", async () => {
|
|
32
|
+
const expectedRequest = nock(baseUrl)
|
|
33
|
+
.get(`/groups/${projectId}/clusters/mycluster/fts/indexes/myindexId?key1=value1&key2=value2`)
|
|
34
|
+
.reply(200, {"atlasSearch": "name"});
|
|
35
|
+
const result = await client.atlasSearch.get("mycluster", "myindexId", {"key1": "value1", "key2": "value2"});
|
|
36
|
+
expect(result).to.equal({"atlasSearch": "name"});
|
|
37
|
+
expect(expectedRequest.isDone()).to.be.true();
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
describe("When getAll is called with querystring parameters", () => {
|
|
42
|
+
it("should return response", async () => {
|
|
43
|
+
const expectedRequest = nock(baseUrl)
|
|
44
|
+
.get(`/groups/${projectId}/clusters/mycluster/fts/indexes/mydatabasename/mycollectionname?key1=value1&key2=value2`)
|
|
45
|
+
.reply(200, [{"atlasSearch": "name"}]);
|
|
46
|
+
const result = await client.atlasSearch.getAll("mycluster", "mydatabasename", "mycollectionname", {"key1": "value1", "key2": "value2"});
|
|
47
|
+
expect(result).to.equal([{"atlasSearch": "name"}]);
|
|
48
|
+
expect(expectedRequest.isDone()).to.be.true();
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
describe("When getAllAnalyzers is called with querystring parameters", () => {
|
|
53
|
+
it("should return response", async () => {
|
|
54
|
+
const expectedRequest = nock(baseUrl)
|
|
55
|
+
.get(`/groups/${projectId}/clusters/mycluster/fts/analyzers?key1=value1&key2=value2`)
|
|
56
|
+
.reply(200, [{"atlasSearch": "name"}]);
|
|
57
|
+
const result = await client.atlasSearch.getAllAnalyzers("mycluster", {"key1": "value1", "key2": "value2"});
|
|
58
|
+
expect(result).to.equal([{"atlasSearch": "name"}]);
|
|
59
|
+
expect(expectedRequest.isDone()).to.be.true();
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
describe("When update is called with querystring parameters", () => {
|
|
64
|
+
it("should return response", async () => {
|
|
65
|
+
const expectedRequest = nock(baseUrl)
|
|
66
|
+
.patch(`/groups/${projectId}/clusters/mycluster/fts/indexes/indexId?key1=value1&key2=value2`)
|
|
67
|
+
.reply(200, [{"atlasSearch": "name"}]);
|
|
68
|
+
const result = await client.atlasSearch.update("mycluster", "indexId", {"body": "value"}, {"key1": "value1", "key2": "value2"});
|
|
69
|
+
expect(result).to.equal([{"atlasSearch": "name"}]);
|
|
70
|
+
expect(expectedRequest.isDone()).to.be.true();
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
describe("When upsertAnalyzer is called with querystring parameters", () => {
|
|
75
|
+
it("should return response", async () => {
|
|
76
|
+
const expectedRequest = nock(baseUrl)
|
|
77
|
+
.put(`/groups/${projectId}/clusters/mycluster/fts/analyzers?key1=value1&key2=value2`)
|
|
78
|
+
.reply(200, [{"atlasSearch": "name"}]);
|
|
79
|
+
const result = await client.atlasSearch.upsertAnalyzer("mycluster", {"body": "value"}, {"key1": "value1", "key2": "value2"});
|
|
80
|
+
expect(result).to.equal([{"atlasSearch": "name"}]);
|
|
81
|
+
expect(expectedRequest.isDone()).to.be.true();
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
describe("When create is called with querystring parameters", () => {
|
|
86
|
+
it("should return response", async () => {
|
|
87
|
+
const expectedRequest = nock(baseUrl)
|
|
88
|
+
.post(`/groups/${projectId}/clusters/mycluster/fts/indexes?key1=value1&key2=value2`)
|
|
89
|
+
.reply(200, [{"atlasSearch": "name"}]);
|
|
90
|
+
const result = await client.atlasSearch.create("mycluster", {"body": "value"}, {"key1": "value1", "key2": "value2"});
|
|
91
|
+
expect(result).to.equal([{"atlasSearch": "name"}]);
|
|
92
|
+
expect(expectedRequest.isDone()).to.be.true();
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
describe("When delete is called with querystring parameters", () => {
|
|
97
|
+
it("should return response", async () => {
|
|
98
|
+
const expectedRequest = nock(baseUrl)
|
|
99
|
+
.delete(`/groups/${projectId}/clusters/mycluster/fts/indexes/indexId?key1=value1&key2=value2`)
|
|
100
|
+
.reply(200, true);
|
|
101
|
+
const result = await client.atlasSearch.delete("mycluster", "indexId", {"key1": "value1", "key2": "value2"});
|
|
102
|
+
expect(result).to.be.true();
|
|
103
|
+
expect(expectedRequest.isDone()).to.be.true();
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
});
|