forked from mongodb/mongo-c-driver
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
From PR mongodb/specifications#1442
- Loading branch information
Showing
6 changed files
with
687 additions
and
0 deletions.
There are no files selected for viewing
136 changes: 136 additions & 0 deletions
136
src/libmongoc/tests/json/index-management/createSearchIndex.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
{ | ||
"description": "createSearchIndex", | ||
"schemaVersion": "1.4", | ||
"createEntities": [ | ||
{ | ||
"client": { | ||
"id": "client0", | ||
"useMultipleMongoses": false, | ||
"observeEvents": [ | ||
"commandStartedEvent" | ||
] | ||
} | ||
}, | ||
{ | ||
"database": { | ||
"id": "database0", | ||
"client": "client0", | ||
"databaseName": "database0" | ||
} | ||
}, | ||
{ | ||
"collection": { | ||
"id": "collection0", | ||
"database": "database0", | ||
"collectionName": "collection0" | ||
} | ||
} | ||
], | ||
"runOnRequirements": [ | ||
{ | ||
"minServerVersion": "7.0.0", | ||
"topologies": [ | ||
"replicaset", | ||
"load-balanced", | ||
"sharded" | ||
], | ||
"serverless": "forbid" | ||
} | ||
], | ||
"tests": [ | ||
{ | ||
"description": "no name provided for an index definition", | ||
"operations": [ | ||
{ | ||
"name": "createSearchIndex", | ||
"object": "collection0", | ||
"arguments": { | ||
"model": { | ||
"definition": { | ||
"mappings": { | ||
"dynamic": true | ||
} | ||
} | ||
} | ||
}, | ||
"expectError": { | ||
"isError": true, | ||
"errorContains": "Search index commands are only supported with Atlas" | ||
} | ||
} | ||
], | ||
"expectEvents": [ | ||
{ | ||
"client": "client0", | ||
"events": [ | ||
{ | ||
"commandStartedEvent": { | ||
"command": { | ||
"createSearchIndexes": "collection0", | ||
"indexes": [ | ||
{ | ||
"definition": { | ||
"mappings": { | ||
"dynamic": true | ||
} | ||
} | ||
} | ||
], | ||
"$db": "database0" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"description": "name provided for an index definition", | ||
"operations": [ | ||
{ | ||
"name": "createSearchIndex", | ||
"object": "collection0", | ||
"arguments": { | ||
"model": { | ||
"definition": { | ||
"mappings": { | ||
"dynamic": true | ||
} | ||
}, | ||
"name": "test index" | ||
} | ||
}, | ||
"expectError": { | ||
"isError": true, | ||
"errorContains": "Search index commands are only supported with Atlas" | ||
} | ||
} | ||
], | ||
"expectEvents": [ | ||
{ | ||
"client": "client0", | ||
"events": [ | ||
{ | ||
"commandStartedEvent": { | ||
"command": { | ||
"createSearchIndexes": "collection0", | ||
"indexes": [ | ||
{ | ||
"definition": { | ||
"mappings": { | ||
"dynamic": true | ||
} | ||
}, | ||
"name": "test index" | ||
} | ||
], | ||
"$db": "database0" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
172 changes: 172 additions & 0 deletions
172
src/libmongoc/tests/json/index-management/createSearchIndexes.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,172 @@ | ||
{ | ||
"description": "createSearchIndexes", | ||
"schemaVersion": "1.4", | ||
"createEntities": [ | ||
{ | ||
"client": { | ||
"id": "client0", | ||
"useMultipleMongoses": false, | ||
"observeEvents": [ | ||
"commandStartedEvent" | ||
] | ||
} | ||
}, | ||
{ | ||
"database": { | ||
"id": "database0", | ||
"client": "client0", | ||
"databaseName": "database0" | ||
} | ||
}, | ||
{ | ||
"collection": { | ||
"id": "collection0", | ||
"database": "database0", | ||
"collectionName": "collection0" | ||
} | ||
} | ||
], | ||
"runOnRequirements": [ | ||
{ | ||
"minServerVersion": "7.0.0", | ||
"topologies": [ | ||
"replicaset", | ||
"load-balanced", | ||
"sharded" | ||
], | ||
"serverless": "forbid" | ||
} | ||
], | ||
"tests": [ | ||
{ | ||
"description": "empty index definition array", | ||
"operations": [ | ||
{ | ||
"name": "createSearchIndexes", | ||
"object": "collection0", | ||
"arguments": { | ||
"models": [] | ||
}, | ||
"expectError": { | ||
"isError": true, | ||
"errorContains": "Search index commands are only supported with Atlas" | ||
} | ||
} | ||
], | ||
"expectEvents": [ | ||
{ | ||
"client": "client0", | ||
"events": [ | ||
{ | ||
"commandStartedEvent": { | ||
"command": { | ||
"createSearchIndexes": "collection0", | ||
"indexes": [], | ||
"$db": "database0" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"description": "no name provided for an index definition", | ||
"operations": [ | ||
{ | ||
"name": "createSearchIndexes", | ||
"object": "collection0", | ||
"arguments": { | ||
"models": [ | ||
{ | ||
"definition": { | ||
"mappings": { | ||
"dynamic": true | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"expectError": { | ||
"isError": true, | ||
"errorContains": "Search index commands are only supported with Atlas" | ||
} | ||
} | ||
], | ||
"expectEvents": [ | ||
{ | ||
"client": "client0", | ||
"events": [ | ||
{ | ||
"commandStartedEvent": { | ||
"command": { | ||
"createSearchIndexes": "collection0", | ||
"indexes": [ | ||
{ | ||
"definition": { | ||
"mappings": { | ||
"dynamic": true | ||
} | ||
} | ||
} | ||
], | ||
"$db": "database0" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"description": "name provided for an index definition", | ||
"operations": [ | ||
{ | ||
"name": "createSearchIndexes", | ||
"object": "collection0", | ||
"arguments": { | ||
"models": [ | ||
{ | ||
"definition": { | ||
"mappings": { | ||
"dynamic": true | ||
} | ||
}, | ||
"name": "test index" | ||
} | ||
] | ||
}, | ||
"expectError": { | ||
"isError": true, | ||
"errorContains": "Search index commands are only supported with Atlas" | ||
} | ||
} | ||
], | ||
"expectEvents": [ | ||
{ | ||
"client": "client0", | ||
"events": [ | ||
{ | ||
"commandStartedEvent": { | ||
"command": { | ||
"createSearchIndexes": "collection0", | ||
"indexes": [ | ||
{ | ||
"definition": { | ||
"mappings": { | ||
"dynamic": true | ||
} | ||
}, | ||
"name": "test index" | ||
} | ||
], | ||
"$db": "database0" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
74 changes: 74 additions & 0 deletions
74
src/libmongoc/tests/json/index-management/dropSearchIndex.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
{ | ||
"description": "dropSearchIndex", | ||
"schemaVersion": "1.4", | ||
"createEntities": [ | ||
{ | ||
"client": { | ||
"id": "client0", | ||
"useMultipleMongoses": false, | ||
"observeEvents": [ | ||
"commandStartedEvent" | ||
] | ||
} | ||
}, | ||
{ | ||
"database": { | ||
"id": "database0", | ||
"client": "client0", | ||
"databaseName": "database0" | ||
} | ||
}, | ||
{ | ||
"collection": { | ||
"id": "collection0", | ||
"database": "database0", | ||
"collectionName": "collection0" | ||
} | ||
} | ||
], | ||
"runOnRequirements": [ | ||
{ | ||
"minServerVersion": "7.0.0", | ||
"topologies": [ | ||
"replicaset", | ||
"load-balanced", | ||
"sharded" | ||
], | ||
"serverless": "forbid" | ||
} | ||
], | ||
"tests": [ | ||
{ | ||
"description": "sends the correct command", | ||
"operations": [ | ||
{ | ||
"name": "dropSearchIndex", | ||
"object": "collection0", | ||
"arguments": { | ||
"name": "test index" | ||
}, | ||
"expectError": { | ||
"isError": true, | ||
"errorContains": "Search index commands are only supported with Atlas" | ||
} | ||
} | ||
], | ||
"expectEvents": [ | ||
{ | ||
"client": "client0", | ||
"events": [ | ||
{ | ||
"commandStartedEvent": { | ||
"command": { | ||
"dropSearchIndex": "collection0", | ||
"name": "test index", | ||
"$db": "database0" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
Oops, something went wrong.