ROOTPLOIT
Server: LiteSpeed
System: Linux in-mum-web1878.main-hosting.eu 5.14.0-570.21.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jun 11 07:22:35 EDT 2025 x86_64
User: u435929562 (435929562)
PHP: 7.4.33
Disabled: system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Upload Files
File: //proc/self/root/opt/go/pkg/mod/go.mongodb.org/[email protected]/testdata/crud/unified/find.yml
description: "find"

schemaVersion: "1.0"

createEntities:
  - client:
      id: &client0 client0
      useMultipleMongoses: true # ensure cursors pin to a single server
      observeEvents: [ commandStartedEvent ]
  - database:
      id: &database0 database0
      client: *client0
      databaseName: &database0Name find-tests
  - collection:
      id: &collection0 collection0
      database: *database0
      collectionName: &collection0Name coll0

initialData:
  - collectionName: *collection0Name
    databaseName: *database0Name
    documents:
      - { _id: 1, x: 11 }
      - { _id: 2, x: 22 }
      - { _id: 3, x: 33 }
      - { _id: 4, x: 44 }
      - { _id: 5, x: 55 }
      - { _id: 6, x: 66 }

tests:
  - description: "find with multiple batches works"
    operations:
      - name: find
        arguments:
          filter: { _id: { $gt: 1 } }
          batchSize: 2
        object: *collection0
        expectResult:
          - { _id: 2, x: 22 }
          - { _id: 3, x: 33 }
          - { _id: 4, x: 44 }
          - { _id: 5, x: 55 }
          - { _id: 6, x: 66 }
    expectEvents:
      - client: *client0
        events:
          - commandStartedEvent:
              command:
                find: *collection0Name
                filter: { _id: { $gt: 1 } }
                batchSize: 2
              commandName: find
              databaseName: *database0Name
          - commandStartedEvent:
              command:
                getMore: { $$type: [ int, long ] }
                collection: *collection0Name
                batchSize: 2
              commandName: getMore
              databaseName: *database0Name
          - commandStartedEvent:
              command:
                getMore: { $$type: [ int, long ] }
                collection: *collection0Name
                batchSize: 2
              commandName: getMore
              databaseName: *database0Name