| 1 | { |
| 2 | "description": "createSearchIndex", |
| 3 | "schemaVersion": "1.4", |
| 4 | "createEntities": [ |
| 5 | { |
| 6 | "client": { |
| 7 | "id": "client0", |
| 8 | "useMultipleMongoses": false, |
| 9 | "observeEvents": [ |
| 10 | "commandStartedEvent" |
| 11 | ] |
| 12 | } |
| 13 | }, |
| 14 | { |
| 15 | "database": { |
| 16 | "id": "database0", |
| 17 | "client": "client0", |
| 18 | "databaseName": "database0" |
| 19 | } |
| 20 | }, |
| 21 | { |
| 22 | "collection": { |
| 23 | "id": "collection0", |
| 24 | "database": "database0", |
| 25 | "collectionName": "collection0" |
| 26 | } |
| 27 | } |
| 28 | ], |
| 29 | "runOnRequirements": [ |
| 30 | { |
| 31 | "minServerVersion": "7.0.0", |
| 32 | "topologies": [ |
| 33 | "replicaset", |
| 34 | "load-balanced", |
| 35 | "sharded" |
| 36 | ], |
| 37 | "serverless": "forbid" |
| 38 | } |
| 39 | ], |
| 40 | "tests": [ |
| 41 | { |
| 42 | "description": "no name provided for an index definition", |
| 43 | "operations": [ |
| 44 | { |
| 45 | "name": "createSearchIndex", |
| 46 | "object": "collection0", |
| 47 | "arguments": { |
| 48 | "model": { |
| 49 | "definition": { |
| 50 | "mappings": { |
| 51 | "dynamic": true |
| 52 | } |
| 53 | }, |
| 54 | "type": "search" |
| 55 | } |
| 56 | }, |
| 57 | "expectError": { |
| 58 | "isError": true, |
| 59 | "errorContains": "Atlas" |
| 60 | } |
| 61 | } |
| 62 | ], |
| 63 | "expectEvents": [ |
| 64 | { |
| 65 | "client": "client0", |
| 66 | "events": [ |
| 67 | { |
| 68 | "commandStartedEvent": { |
| 69 | "command": { |
| 70 | "createSearchIndexes": "collection0", |
| 71 | "indexes": [ |
| 72 | { |
| 73 | "definition": { |
| 74 | "mappings": { |
| 75 | "dynamic": true |
| 76 | } |
| 77 | }, |
| 78 | "type": "search" |
| 79 | } |
| 80 | ], |
| 81 | "$db": "database0" |
| 82 | } |
| 83 | } |
| 84 | } |
| 85 | ] |
| 86 | } |
| 87 | ] |
| 88 | }, |
| 89 | { |
| 90 | "description": "name provided for an index definition", |
| 91 | "operations": [ |
| 92 | { |
| 93 | "name": "createSearchIndex", |
| 94 | "object": "collection0", |
| 95 | "arguments": { |
| 96 | "model": { |
| 97 | "definition": { |
| 98 | "mappings": { |
| 99 | "dynamic": true |
| 100 | } |
| 101 | }, |
| 102 | "name": "test index", |
| 103 | "type": "search" |
| 104 | } |
| 105 | }, |
| 106 | "expectError": { |
| 107 | "isError": true, |
| 108 | "errorContains": "Atlas" |
| 109 | } |
| 110 | } |
| 111 | ], |
| 112 | "expectEvents": [ |
| 113 | { |
| 114 | "client": "client0", |
| 115 | "events": [ |
| 116 | { |
| 117 | "commandStartedEvent": { |
| 118 | "command": { |
| 119 | "createSearchIndexes": "collection0", |
| 120 | "indexes": [ |
| 121 | { |
| 122 | "definition": { |
| 123 | "mappings": { |
| 124 | "dynamic": true |
| 125 | } |
| 126 | }, |
| 127 | "name": "test index", |
| 128 | "type": "search" |
| 129 | } |
| 130 | ], |
| 131 | "$db": "database0" |
| 132 | } |
| 133 | } |
| 134 | } |
| 135 | ] |
| 136 | } |
| 137 | ] |
| 138 | }, |
| 139 | { |
| 140 | "description": "create a vector search index", |
| 141 | "operations": [ |
| 142 | { |
| 143 | "name": "createSearchIndex", |
| 144 | "object": "collection0", |
| 145 | "arguments": { |
| 146 | "model": { |
| 147 | "definition": { |
| 148 | "fields": [ |
| 149 | { |
| 150 | "type": "vector", |
| 151 | "path": "plot_embedding", |
| 152 | "numDimensions": 1536, |
| 153 | "similarity": "euclidean" |
| 154 | } |
| 155 | ] |
| 156 | }, |
| 157 | "name": "test index", |
| 158 | "type": "vectorSearch" |
| 159 | } |
| 160 | }, |
| 161 | "expectError": { |
| 162 | "isError": true, |
| 163 | "errorContains": "Atlas" |
| 164 | } |
| 165 | } |
| 166 | ], |
| 167 | "expectEvents": [ |
| 168 | { |
| 169 | "client": "client0", |
| 170 | "events": [ |
| 171 | { |
| 172 | "commandStartedEvent": { |
| 173 | "command": { |
| 174 | "createSearchIndexes": "collection0", |
| 175 | "indexes": [ |
| 176 | { |
| 177 | "definition": { |
| 178 | "fields": [ |
| 179 | { |
| 180 | "type": "vector", |
| 181 | "path": "plot_embedding", |
| 182 | "numDimensions": 1536, |
| 183 | "similarity": "euclidean" |
| 184 | } |
| 185 | ] |
| 186 | }, |
| 187 | "name": "test index", |
| 188 | "type": "vectorSearch" |
| 189 | } |
| 190 | ], |
| 191 | "$db": "database0" |
| 192 | } |
| 193 | } |
| 194 | } |
| 195 | ] |
| 196 | } |
| 197 | ] |
| 198 | } |
| 199 | ] |
| 200 | } |