runOn:
  - { minServerVersion: "4.3.4" }

data:
  - {_id: 1, x: 11}
  - {_id: 2, x: 22}

collection_name: &collection_name 'DeleteOne_hint'

tests:
  -
    description: "DeleteOne with hint string"
    operations:
      -
        object: collection
        name: deleteOne
        arguments:
          filter: &filter { _id: 1 }
          hint: "_id_"
        result: &result
          deletedCount: 1
    expectations:
      -
        command_started_event:
          command:
            delete: *collection_name
            deletes:
              -
                q: *filter
                hint: "_id_"
                limit: 1
    outcome: &outcome
      collection:
        data:
          - {_id: 2, x: 22 }
  -
    description: "deleteOne with hint document"
    operations:
      -
        object: collection
        name: deleteOne
        arguments:
          filter: *filter
          hint: { _id: 1 }
        result: *result
    expectations:
      -
        command_started_event:
          command:
            delete: *collection_name
            deletes:
              -
                q: *filter
                hint: { _id: 1 }
                limit: 1
    outcome: *outcome

