Debian Codegraph @

testdata/crud/v1/write/findOneAndDelete.yml

raw
1 data:
2 - {_id: 1, x: 11}
3 - {_id: 2, x: 22}
4 - {_id: 3, x: 33}
5
6 tests:
7 -
8 description: "FindOneAndDelete when many documents match"
9 operation:
10 name: findOneAndDelete
11 arguments:
12 filter:
13 _id: {$gt: 1}
14 projection: {x: 1, _id: 0}
15 sort: {x: 1}
16
17 outcome:
18 result: {x: 22}
19 collection:
20 data:
21 - {_id: 1, x: 11}
22 - {_id: 3, x: 33}
23 -
24 description: "FindOneAndDelete when one document matches"
25 operation:
26 name: findOneAndDelete
27 arguments:
28 filter: {_id: 2}
29 projection: {x: 1, _id: 0}
30 sort: {x: 1}
31
32 outcome:
33 result: {x: 22}
34 collection:
35 data:
36 - {_id: 1, x: 11}
37 - {_id: 3, x: 33}
38 -
39 description: "FindOneAndDelete when no documents match"
40 operation:
41 name: findOneAndDelete
42 arguments:
43 filter: {_id: 4}
44 projection: {x: 1, _id: 0}
45 sort: {x: 1}
46
47 outcome:
48 result: null
49 collection:
50 data:
51 - {_id: 1, x: 11}
52 - {_id: 2, x: 22}
53 - {_id: 3, x: 33}