File: bulk_write.yml

package info (click to toggle)
ruby-mongo 2.23.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 15,020 kB
  • sloc: ruby: 110,810; makefile: 5
file content (198 lines) | stat: -rw-r--r-- 6,823 bytes parent folder | download
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
description: operation bulk_write
schemaVersion: '1.27'
runOnRequirements:
  - minServerVersion: "8.0"
    serverless: forbid

createEntities:
  - client:
      id: &client0 client0
      useMultipleMongoses: false
      observeTracingMessages:
        enableCommandPayload: true
  - database:
      id: &database0 database0
      client: *client0
      databaseName: &databaseName0 operation-bulk-write-0
  - database:
      id: &database1 database1
      client: *client0
      databaseName: &databaseName1 operation-bulk-write-1
  - collection:
      id: collection0
      database: *database0
      collectionName: &collectionName0 test0
  - collection:
      id: collection1
      database: *database1
      collectionName: &collectionName1 test1

initialData:
  - collectionName: *collectionName0
    databaseName: *databaseName0
    documents: [ ]
  - collectionName: *collectionName1
    databaseName: *databaseName1
    documents: [ ]

_yamlAnchors:
  namespace0: &namespace0 "operation-bulk-write-0.test0"
  namespace1: &namespace1 "operation-bulk-write-1.test1"

tests:
  - description: bulkWrite
    operations:
      - object: *client0
        name: clientBulkWrite
        arguments:
          models:
            - insertOne:
                namespace: *namespace0
                document: { _id: 8, x: 88 }
            - updateOne:
                namespace: *namespace0
                filter: { _id: 1 }
                update: { $inc: { x: 1 } }
            - updateMany:
                namespace: *namespace1
                filter:
                  $and: [ { _id: { $gt: 1 } }, { _id: { $lte: 3 } } ]
                update: { $inc: { x: 2 } }
            - replaceOne:
                namespace: *namespace1
                filter: { _id: 4 }
                replacement: { x: 44 }
                upsert: true
            - deleteOne:
                namespace: *namespace0
                filter: { _id: 5 }
            - deleteMany:
                namespace: *namespace1
                filter:
                  $and: [ { _id: { $gt: 5 } }, { _id: { $lte: 7 } } ]

    expectTracingMessages:
      - client: *client0
        ignoreExtraSpans: false
        spans:
          - name: bulkWrite admin
            attributes:
              db.system: mongodb
              db.namespace: admin
              db.collection.name: { $$exists: false }
              db.operation.name: bulkWrite
              db.operation.summary: bulkWrite admin
            nested:
              - name: bulkWrite
                attributes:
                  db.system: mongodb
                  db.namespace: admin
                  db.collection.name: { $$exists: false }
                  db.command.name: bulkWrite
                  network.transport: tcp
                  db.mongodb.cursor_id: { $$exists: false }
                  db.response.status_code: { $$exists: false }
                  exception.message: { $$exists: false }
                  exception.type: { $$exists: false }
                  exception.stacktrace: { $$exists: false }
                  server.address: { $$type: string }
                  server.port: { $$type: [ int, long ] }
                  db.query.summary: bulkWrite admin
                  db.query.text:
                    $$matchAsDocument:
                      $$matchAsRoot:
                        bulkWrite: 1
                        errorsOnly: true
                        ordered: true
                        ops: [
                          {
                            "insert": 0,
                            "document": {
                              "_id": 8,
                              "x": 88
                            }
                          },
                          {
                            "update": 0,
                            "multi": false,
                            "filter": {
                              "_id": 1
                            },
                            "updateMods": {
                              "$inc": {
                                "x": 1
                              }
                            }
                          },
                          {
                            "update": 1,
                            "multi": true,
                            "filter": {
                              "$and": [
                                {
                                  "_id": {
                                    "$gt": 1
                                  }
                                },
                                {
                                  "_id": {
                                    "$lte": 3
                                  }
                                }
                              ]
                            },
                            "updateMods": {
                              "$inc": {
                                "x": 2
                              }
                            }
                          },
                          {
                            "update": 1,
                            "multi": false,
                            "filter": {
                              "_id": 4
                            },
                            "updateMods": {
                              "x": 44
                            },
                            "upsert": true
                          },
                          {
                            "delete": 0,
                            "multi": false,
                            "filter": {
                              "_id": 5
                            }
                          },
                          {
                            "delete": 1,
                            "multi": true,
                            "filter": {
                              "$and": [
                                {
                                  "_id": {
                                    "$gt": 5
                                  }
                                },
                                {
                                  "_id": {
                                    "$lte": 7
                                  }
                                }
                              ]
                            }
                          }
                        ]
                        nsInfo: [
                          {
                            "ns": *namespace0
                          },
                          {
                            "ns": *namespace1
                          }
                        ]
                  db.mongodb.server_connection_id:
                    $$type: [ int, long ]
                  db.mongodb.driver_connection_id:
                    $$type: [ int, long ]