...

Text file src/go.mongodb.org/mongo-driver/testdata/index-management/createSearchIndex.json

Documentation: go.mongodb.org/mongo-driver/testdata/index-management

     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            }
    55          },
    56          "expectError": {
    57            "isError": true,
    58            "errorContains": "Atlas"
    59          }
    60        }
    61      ],
    62      "expectEvents": [
    63        {
    64          "client": "client0",
    65          "events": [
    66            {
    67              "commandStartedEvent": {
    68                "command": {
    69                  "createSearchIndexes": "collection0",
    70                  "indexes": [
    71                    {
    72                      "definition": {
    73                        "mappings": {
    74                          "dynamic": true
    75                        }
    76                      }
    77                    }
    78                  ],
    79                  "$db": "database0"
    80                }
    81              }
    82            }
    83          ]
    84        }
    85      ]
    86    },
    87    {
    88      "description": "name provided for an index definition",
    89      "operations": [
    90        {
    91          "name": "createSearchIndex",
    92          "object": "collection0",
    93          "arguments": {
    94            "model": {
    95              "definition": {
    96                "mappings": {
    97                  "dynamic": true
    98                }
    99              },
   100              "name": "test index"
   101            }
   102          },
   103          "expectError": {
   104            "isError": true,
   105            "errorContains": "Atlas"
   106          }
   107        }
   108      ],
   109      "expectEvents": [
   110        {
   111          "client": "client0",
   112          "events": [
   113            {
   114              "commandStartedEvent": {
   115                "command": {
   116                  "createSearchIndexes": "collection0",
   117                  "indexes": [
   118                    {
   119                      "definition": {
   120                        "mappings": {
   121                          "dynamic": true
   122                        }
   123                      },
   124                      "name": "test index"
   125                    }
   126                  ],
   127                  "$db": "database0"
   128                }
   129              }
   130            }
   131          ]
   132        }
   133      ]
   134    }
   135  ]
   136}

View as plain text