...
1{
2 "description": "entity-cursor-iterateOnce",
3 "schemaVersion": "1.5",
4 "createEntities": [
5 {
6 "client": {
7 "id": "client0",
8 "observeEvents": [
9 "commandStartedEvent"
10 ]
11 }
12 },
13 {
14 "database": {
15 "id": "database0",
16 "client": "client0",
17 "databaseName": "database0"
18 }
19 },
20 {
21 "collection": {
22 "id": "collection0",
23 "database": "database0",
24 "collectionName": "coll0"
25 }
26 }
27 ],
28 "initialData": [
29 {
30 "databaseName": "database0",
31 "collectionName": "coll0",
32 "documents": [
33 {
34 "_id": 1
35 },
36 {
37 "_id": 2
38 },
39 {
40 "_id": 3
41 }
42 ]
43 }
44 ],
45 "tests": [
46 {
47 "description": "iterateOnce",
48 "operations": [
49 {
50 "name": "createFindCursor",
51 "object": "collection0",
52 "arguments": {
53 "filter": {},
54 "batchSize": 2
55 },
56 "saveResultAsEntity": "cursor0"
57 },
58 {
59 "name": "iterateUntilDocumentOrError",
60 "object": "cursor0",
61 "expectResult": {
62 "_id": 1
63 }
64 },
65 {
66 "name": "iterateUntilDocumentOrError",
67 "object": "cursor0",
68 "expectResult": {
69 "_id": 2
70 }
71 },
72 {
73 "name": "iterateOnce",
74 "object": "cursor0"
75 }
76 ],
77 "expectEvents": [
78 {
79 "client": "client0",
80 "events": [
81 {
82 "commandStartedEvent": {
83 "command": {
84 "find": "coll0",
85 "filter": {},
86 "batchSize": 2
87 },
88 "commandName": "find",
89 "databaseName": "database0"
90 }
91 },
92 {
93 "commandStartedEvent": {
94 "command": {
95 "getMore": {
96 "$$type": "long"
97 },
98 "collection": "coll0"
99 },
100 "commandName": "getMore"
101 }
102 }
103 ]
104 }
105 ]
106 }
107 ]
108}
View as plain text