{
  "data": [
    {
      "_id": 1,
      "x": 11
    },
    {
      "_id": 2,
      "x": 22
    },
    {
      "_id": 3,
      "x": 33
    },
    {
      "_id": 4,
      "x": 44
    },
    {
      "_id": 5,
      "x": 55
    }
  ],
  "collection_name": "test",
  "database_name": "command-monitoring-tests",
  "namespace": "command-monitoring-tests.test",
  "tests": [
    {
      "description": "A successful find event with no options",
      "operation": {
        "name": "find",
        "arguments": {
          "filter": {
            "_id": 1
          }
        }
      },
      "expectations": [
        {
          "command_started_event": {
            "command": {
              "find": "test",
              "filter": {
                "_id": 1
              }
            },
            "command_name": "find",
            "database_name": "command-monitoring-tests"
          }
        },
        {
          "command_succeeded_event": {
            "reply": {
              "ok": 1,
              "cursor": {
                "id": {
                  "$numberLong": "0"
                },
                "ns": "command-monitoring-tests.test",
                "firstBatch": [
                  {
                    "_id": 1,
                    "x": 11
                  }
                ]
              }
            },
            "command_name": "find"
          }
        }
      ]
    },
    {
      "description": "A successful find event with options",
      "operation": {
        "name": "find",
        "read_preference": {
          "mode": "primaryPreferred"
        },
        "arguments": {
          "filter": {
            "_id": {
              "$gt": 1
            }
          },
          "sort": {
            "_id": 1
          },
          "skip": {
            "$numberLong": "2"
          },
          "comment": "test",
          "hint": {
            "_id": 1
          },
          "max": {
            "_id": 6
          },
          "maxTimeMS": 6000,
          "min": {
            "_id": 0
          },
          "returnKey": false,
          "showRecordId": false
        }
      },
      "expectations": [
        {
          "command_started_event": {
            "command": {
              "find": "test",
              "filter": {
                "_id": {
                  "$gt": 1
                }
              },
              "sort": {
                "_id": 1
              },
              "skip": {
                "$numberLong": "2"
              },
              "comment": "test",
              "hint": {
                "_id": 1
              },
              "max": {
                "_id": 6
              },
              "maxTimeMS": 6000,
              "min": {
                "_id": 0
              },
              "returnKey": false,
              "showRecordId": false
            },
            "command_name": "find",
            "database_name": "command-monitoring-tests"
          }
        },
        {
          "command_succeeded_event": {
            "reply": {
              "ok": 1,
              "cursor": {
                "id": {
                  "$numberLong": "0"
                },
                "ns": "command-monitoring-tests.test",
                "firstBatch": [
                  {
                    "_id": 4,
                    "x": 44
                  },
                  {
                    "_id": 5,
                    "x": 55
                  }
                ]
              }
            },
            "command_name": "find"
          }
        }
      ]
    },
    {
      "description": "A successful find event with a getmore",
      "operation": {
        "name": "find",
        "arguments": {
          "filter": {
            "_id": {
              "$gte": 1
            }
          },
          "sort": {
            "_id": 1
          },
          "batchSize": {
            "$numberLong": "3"
          }
        }
      },
      "expectations": [
        {
          "command_started_event": {
            "command": {
              "find": "test",
              "filter": {
                "_id": {
                  "$gte": 1
                }
              },
              "sort": {
                "_id": 1
              },
              "batchSize": {
                "$numberLong": "3"
              }
            },
            "command_name": "find",
            "database_name": "command-monitoring-tests"
          }
        },
        {
          "command_succeeded_event": {
            "reply": {
              "ok": 1,
              "cursor": {
                "id": {
                  "$numberLong": "42"
                },
                "ns": "command-monitoring-tests.test",
                "firstBatch": [
                  {
                    "_id": 1,
                    "x": 11
                  },
                  {
                    "_id": 2,
                    "x": 22
                  },
                  {
                    "_id": 3,
                    "x": 33
                  }
                ]
              }
            },
            "command_name": "find"
          }
        },
        {
          "command_started_event": {
            "command": {
              "getMore": {
                "$numberLong": "42"
              },
              "collection": "test",
              "batchSize": {
                "$numberLong": "3"
              }
            },
            "command_name": "getMore",
            "database_name": "command-monitoring-tests"
          }
        },
        {
          "command_succeeded_event": {
            "reply": {
              "ok": 1,
              "cursor": {
                "id": {
                  "$numberLong": "0"
                },
                "ns": "command-monitoring-tests.test",
                "nextBatch": [
                  {
                    "_id": 4,
                    "x": 44
                  },
                  {
                    "_id": 5,
                    "x": 55
                  }
                ]
              }
            },
            "command_name": "getMore"
          }
        }
      ]
    },
    {
      "description": "A successful find event with a getmore and killcursors",
      "ignore_if_server_version_greater_than": "3.0",
      "operation": {
        "name": "find",
        "arguments": {
          "filter": {
            "_id": {
              "$gte": 1
            }
          },
          "sort": {
            "_id": 1
          },
          "batchSize": {
            "$numberLong": "3"
          },
          "limit": {
            "$numberLong": "4"
          }
        }
      },
      "expectations": [
        {
          "command_started_event": {
            "command": {
              "find": "test",
              "filter": {
                "_id": {
                  "$gte": 1
                }
              },
              "sort": {
                "_id": 1
              },
              "batchSize": {
                "$numberLong": "3"
              },
              "limit": {
                "$numberLong": "4"
              }
            },
            "command_name": "find",
            "database_name": "command-monitoring-tests"
          }
        },
        {
          "command_succeeded_event": {
            "reply": {
              "ok": 1,
              "cursor": {
                "id": {
                  "$numberLong": "42"
                },
                "ns": "command-monitoring-tests.test",
                "firstBatch": [
                  {
                    "_id": 1,
                    "x": 11
                  },
                  {
                    "_id": 2,
                    "x": 22
                  },
                  {
                    "_id": 3,
                    "x": 33
                  }
                ]
              }
            },
            "command_name": "find"
          }
        },
        {
          "command_started_event": {
            "command": {
              "getMore": {
                "$numberLong": "42"
              },
              "collection": "test",
              "batchSize": {
                "$numberLong": "1"
              }
            },
            "command_name": "getMore",
            "database_name": "command-monitoring-tests"
          }
        },
        {
          "command_succeeded_event": {
            "reply": {
              "ok": 1,
              "cursor": {
                "id": {
                  "$numberLong": "42"
                },
                "ns": "command-monitoring-tests.test",
                "nextBatch": [
                  {
                    "_id": 4,
                    "x": 44
                  }
                ]
              }
            },
            "command_name": "getMore"
          }
        },
        {
          "command_started_event": {
            "command": {
              "killCursors": "test",
              "cursors": [
                {
                  "$numberLong": "42"
                }
              ]
            },
            "command_name": "killCursors",
            "database_name": "command-monitoring-tests"
          }
        },
        {
          "command_succeeded_event": {
            "reply": {
              "ok": 1,
              "cursorsUnknown": [
                {
                  "$numberLong": "42"
                }
              ]
            },
            "command_name": "killCursors"
          }
        }
      ]
    },
    {
      "description": "A successful find event with a getmore and the server kills the cursor (<= 4.4)",
      "ignore_if_server_version_less_than": "3.1",
      "ignore_if_server_version_greater_than": "4.4",
      "ignore_if_topology_type": [
        "sharded"
      ],
      "operation": {
        "name": "find",
        "arguments": {
          "filter": {
            "_id": {
              "$gte": 1
            }
          },
          "sort": {
            "_id": 1
          },
          "batchSize": {
            "$numberLong": "3"
          },
          "limit": {
            "$numberLong": "4"
          }
        }
      },
      "expectations": [
        {
          "command_started_event": {
            "command": {
              "find": "test",
              "filter": {
                "_id": {
                  "$gte": 1
                }
              },
              "sort": {
                "_id": 1
              },
              "batchSize": {
                "$numberLong": "3"
              },
              "limit": {
                "$numberLong": "4"
              }
            },
            "command_name": "find",
            "database_name": "command-monitoring-tests"
          }
        },
        {
          "command_succeeded_event": {
            "reply": {
              "ok": 1,
              "cursor": {
                "id": {
                  "$numberLong": "42"
                },
                "ns": "command-monitoring-tests.test",
                "firstBatch": [
                  {
                    "_id": 1,
                    "x": 11
                  },
                  {
                    "_id": 2,
                    "x": 22
                  },
                  {
                    "_id": 3,
                    "x": 33
                  }
                ]
              }
            },
            "command_name": "find"
          }
        },
        {
          "command_started_event": {
            "command": {
              "getMore": {
                "$numberLong": "42"
              },
              "collection": "test",
              "batchSize": {
                "$numberLong": "1"
              }
            },
            "command_name": "getMore",
            "database_name": "command-monitoring-tests"
          }
        },
        {
          "command_succeeded_event": {
            "reply": {
              "ok": 1,
              "cursor": {
                "id": {
                  "$numberLong": "0"
                },
                "ns": "command-monitoring-tests.test",
                "nextBatch": [
                  {
                    "_id": 4,
                    "x": 44
                  }
                ]
              }
            },
            "command_name": "getMore"
          }
        }
      ]
    },
    {
      "description": "A failed find event",
      "operation": {
        "name": "find",
        "arguments": {
          "filter": {
            "$or": true
          }
        }
      },
      "expectations": [
        {
          "command_started_event": {
            "command": {
              "find": "test",
              "filter": {
                "$or": true
              }
            },
            "command_name": "find",
            "database_name": "command-monitoring-tests"
          }
        },
        {
          "command_failed_event": {
            "command_name": "find"
          }
        }
      ]
    }
  ]
}
