runOn:
  - { minServerVersion: "4.3.4" }

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

collection_name: &collection_name 'DeleteMany_hint'

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

