...
1description: "insertMany-comment"
2schemaVersion: "1.0"
3
4createEntities:
5 - client:
6 id: &client0 client0
7 observeEvents: [ commandStartedEvent ]
8 - database:
9 id: &database0 database0
10 client: *client0
11 databaseName: &database0Name crud-tests
12 - collection:
13 id: &collection0 collection0
14 database: *database0
15 collectionName: &collection0Name coll0
16
17initialData: &initialData
18 - collectionName: *collection0Name
19 databaseName: *database0Name
20 documents:
21 - { _id: 1, x: 11 }
22
23tests:
24 - description: "insertMany with string comment"
25 runOnRequirements:
26 - minServerVersion: "4.4"
27 operations:
28 - name: insertMany
29 object: *collection0
30 arguments:
31 documents:
32 - &document { _id: 2, x: 22 }
33 comment: "comment"
34 expectEvents:
35 - client: *client0
36 events:
37 - commandStartedEvent:
38 command:
39 insert: *collection0Name
40 documents:
41 - *document
42 comment: "comment"
43 outcome: &outcome
44 - collectionName: *collection0Name
45 databaseName: *database0Name
46 documents:
47 - { _id: 1, x: 11 }
48 - { _id: 2, x: 22 }
49
50 - description: "insertMany with document comment"
51 runOnRequirements:
52 - minServerVersion: "4.4"
53 operations:
54 - name: insertMany
55 object: *collection0
56 arguments:
57 documents:
58 - *document
59 comment: &comment { key: "value" }
60 expectEvents:
61 - client: *client0
62 events:
63 - commandStartedEvent:
64 command:
65 insert: *collection0Name
66 documents:
67 - *document
68 comment: *comment
69 outcome: *outcome
70
71 - description: "insertMany with comment - pre 4.4"
72 runOnRequirements:
73 - minServerVersion: "3.4.0"
74 maxServerVersion: "4.2.99"
75 operations:
76 - name: insertMany
77 object: *collection0
78 arguments:
79 documents:
80 - *document
81 comment: "comment"
82 expectError:
83 isClientError: false
84 expectEvents:
85 - client: *client0
86 events:
87 - commandStartedEvent:
88 command:
89 insert: *collection0Name
90 documents:
91 - *document
92 comment: "comment"
93 outcome: *initialData
View as plain text