File: find.yml

package info (click to toggle)
golang-mongodb-mongo-driver 1.8.4%2Bds1-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bookworm-backports
  • size: 18,520 kB
  • sloc: perl: 533; ansic: 491; python: 432; makefile: 187; sh: 72
file content (68 lines) | stat: -rw-r--r-- 1,904 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
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