1{
2  "data": [
3    {
4      "_id": 1,
5      "x": 11
6    }
7  ],
8  "collection_name": "test",
9  "database_name": "command-monitoring-tests",
10  "tests": [
11    {
12      "description": "A successful command",
13      "operation": {
14        "name": "count",
15        "arguments": {
16          "filter": {
17            "_id": 1
18          }
19        }
20      },
21      "expectations": [
22        {
23          "command_started_event": {
24            "command": {
25              "count": "test",
26              "query": {
27                "_id": 1
28              }
29            },
30            "command_name": "count",
31            "database_name": "command-monitoring-tests"
32          }
33        },
34        {
35          "command_succeeded_event": {
36            "reply": {
37              "ok": 1,
38              "n": 1
39            },
40            "command_name": "count"
41          }
42        }
43      ]
44    },
45    {
46      "description": "A failed command event",
47      "operation": {
48        "name": "count",
49        "arguments": {
50          "filter": {
51            "$or": true
52          }
53        }
54      },
55      "expectations": [
56        {
57          "command_started_event": {
58            "command": {
59              "count": "test",
60              "query": {
61                "$or": true
62              }
63            },
64            "command_name": "count",
65            "database_name": "command-monitoring-tests"
66          }
67        },
68        {
69          "command_failed_event": {
70            "command_name": "count"
71          }
72        }
73      ]
74    },
75    {
76      "description": "A successful command with a non-primary read preference",
77      "operation": {
78        "name": "count",
79        "arguments": {
80          "filter": {
81            "_id": 1
82          }
83        },
84        "read_preference": {
85          "mode": "primaryPreferred"
86        }
87      },
88      "expectations": [
89        {
90          "command_started_event": {
91            "command": {
92              "count": "test",
93              "query": {
94                "_id": 1
95              }
96            },
97            "command_name": "count",
98            "database_name": "command-monitoring-tests"
99          }
100        },
101        {
102          "command_succeeded_event": {
103            "reply": {
104              "ok": 1,
105              "n": 1
106            },
107            "command_name": "count"
108          }
109        }
110      ]
111    }
112  ]
113}
114