Debian Codegraph @

testdata/collection-management/modifyCollection-errorResponse.json

raw
1 {
2 "description": "modifyCollection-errorResponse",
3 "schemaVersion": "1.12",
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": "collMod-tests"
18 }
19 },
20 {
21 "collection": {
22 "id": "collection0",
23 "database": "database0",
24 "collectionName": "test"
25 }
26 }
27 ],
28 "initialData": [
29 {
30 "collectionName": "test",
31 "databaseName": "collMod-tests",
32 "documents": [
33 {
34 "_id": 1,
35 "x": 1
36 },
37 {
38 "_id": 2,
39 "x": 1
40 }
41 ]
42 }
43 ],
44 "tests": [
45 {
46 "description": "modifyCollection prepareUnique violations are accessible",
47 "runOnRequirements": [
48 {
49 "minServerVersion": "5.2"
50 }
51 ],
52 "operations": [
53 {
54 "name": "createIndex",
55 "object": "collection0",
56 "arguments": {
57 "keys": {
58 "x": 1
59 }
60 }
61 },
62 {
63 "name": "modifyCollection",
64 "object": "database0",
65 "arguments": {
66 "collection": "test",
67 "index": {
68 "keyPattern": {
69 "x": 1
70 },
71 "prepareUnique": true
72 }
73 }
74 },
75 {
76 "name": "insertOne",
77 "object": "collection0",
78 "arguments": {
79 "document": {
80 "_id": 3,
81 "x": 1
82 }
83 },
84 "expectError": {
85 "errorCode": 11000
86 }
87 },
88 {
89 "name": "modifyCollection",
90 "object": "database0",
91 "arguments": {
92 "collection": "test",
93 "index": {
94 "keyPattern": {
95 "x": 1
96 },
97 "unique": true
98 }
99 },
100 "expectError": {
101 "isClientError": false,
102 "errorCode": 359,
103 "errorResponse": {
104 "violations": [
105 {
106 "ids": [
107 1,
108 2
109 ]
110 }
111 ]
112 }
113 }
114 }
115 ]
116 }
117 ]
118 }