...

Text file src/go.mongodb.org/mongo-driver/testdata/load-balancers/server-selection.json

Documentation: go.mongodb.org/mongo-driver/testdata/load-balancers

     1{
     2  "description": "server selection for load-balanced clusters",
     3  "schemaVersion": "1.3",
     4  "runOnRequirements": [
     5    {
     6      "topologies": [
     7        "load-balanced"
     8      ]
     9    }
    10  ],
    11  "createEntities": [
    12    {
    13      "client": {
    14        "id": "client0",
    15        "useMultipleMongoses": true,
    16        "observeEvents": [
    17          "commandStartedEvent"
    18        ]
    19      }
    20    },
    21    {
    22      "database": {
    23        "id": "database0",
    24        "client": "client0",
    25        "databaseName": "database0Name"
    26      }
    27    },
    28    {
    29      "collection": {
    30        "id": "collection0",
    31        "database": "database0",
    32        "collectionName": "coll0",
    33        "collectionOptions": {
    34          "readPreference": {
    35            "mode": "secondaryPreferred"
    36          }
    37        }
    38      }
    39    }
    40  ],
    41  "initialData": [
    42    {
    43      "collectionName": "coll0",
    44      "databaseName": "database0Name",
    45      "documents": []
    46    }
    47  ],
    48  "tests": [
    49    {
    50      "description": "$readPreference is sent for load-balanced clusters",
    51      "operations": [
    52        {
    53          "name": "find",
    54          "object": "collection0",
    55          "arguments": {
    56            "filter": {}
    57          }
    58        }
    59      ],
    60      "expectEvents": [
    61        {
    62          "client": "client0",
    63          "events": [
    64            {
    65              "commandStartedEvent": {
    66                "command": {
    67                  "find": "coll0",
    68                  "filter": {},
    69                  "$readPreference": {
    70                    "mode": "secondaryPreferred"
    71                  }
    72                },
    73                "commandName": "find",
    74                "databaseName": "database0Name"
    75              }
    76            }
    77          ]
    78        }
    79      ]
    80    }
    81  ]
    82}

View as plain text