|
3 | 3 | To quickly find an error by its code, search for the code in this overview. |
4 | 4 |
|
5 | 5 | ## Table of Contents |
6 | | - |
7 | | -- [@mongosh/async-rewriter2](#@mongosh/async-rewriter2) |
8 | | - |
9 | | -- [@mongosh/cli-repl](#@mongosh/cli-repl) |
10 | | - |
11 | | -- [@mongosh/errors](#@mongosh/errors) |
12 | | - |
13 | | -- [@mongosh/shell-api](#@mongosh/shell-api) |
14 | | - |
15 | | -## @mongosh/async-rewriter2 |
16 | | - |
17 | | -#### `ASYNC-10012` |
18 | | - |
19 | | -Signals the use of a Mongosh API call in a place where it is not supported. |
20 | | -This occurs inside of constructors and (non-async) generator functions. |
21 | | - |
22 | | -Examples causing error: |
23 | | - |
24 | | -```javascript |
25 | | -class SomeClass { |
26 | | - constructor() { |
27 | | - this.list = db.coll.find().toArray(); |
28 | | - } |
29 | | -} |
30 | | - |
31 | | -function*() { |
32 | | - yield* db.coll.find().toArray(); |
33 | | -} |
34 | | -``` |
35 | | - |
36 | | -**Solution: Do not use calls directly in such functions. If necessary, place these calls in an inner 'async' function.** |
37 | | - |
38 | | -#### `ASYNC-10013` |
39 | | - |
40 | | -Signals the iteration of a Mongosh API object in a place where it is not supported. |
41 | | -This occurs inside of constructors and (non-async) generator functions. |
42 | | - |
43 | | -Examples causing error: |
44 | | - |
45 | | -```javascript |
46 | | -class SomeClass { |
47 | | - constructor() { |
48 | | - for (const item of db.coll.find()) { ... } |
49 | | - } |
50 | | -} |
51 | | - |
52 | | -function*() { |
53 | | - for (const item of db.coll.find()) yield item; |
54 | | - yield* db.coll.find(); |
55 | | -} |
56 | | -``` |
57 | | - |
58 | | -**Solution: Do not use calls directly in such functions. If necessary, place these calls in an inner 'async' function.** |
59 | | - |
60 | | -## @mongosh/cli-repl |
61 | | - |
62 | | -#### `CLIREPL-10001` |
63 | | - |
64 | | -Signals that the currently installed Node version does not match the one expected by mongosh. |
65 | | - |
66 | | -See the output for further details on the required Node version. |
67 | | - |
68 | | -## @mongosh/errors |
69 | | - |
70 | | -#### `COMMON-10001` |
71 | | - |
72 | | -Signals calling an API method with an invalid argument. |
73 | | - |
74 | | -**Solution: See the error output for details on allowed argument values.** |
75 | | - |
76 | | -#### `COMMON-10002` |
77 | | - |
78 | | -Signals calling an API method that is not allowed in the current state. |
79 | | - |
80 | | -**Solution: See the error output for details.** |
81 | | - |
82 | | -#### `COMMON-10003` |
83 | | - |
84 | | -Signals calling an API method that has been deprecated or using an argument or option of an API method that has been deprecated |
85 | | -and therefore is no longer supported. |
86 | | - |
87 | | -**Solution: See the error output for details on alternatives or consult the official documentation.** |
88 | | - |
89 | | -#### `COMMON-10004` |
90 | | - |
91 | | -Signals an error while running a specific command against the database. |
92 | | - |
93 | | -**Solution: Check the error output for more details and ensure the database is healthy and available.** |
94 | | - |
95 | | -#### `COMMON-90001` |
96 | | - |
97 | | -Signals an unexpected internal error of mongosh. |
98 | | - |
99 | | -**Please file a bug report for the `MONGOSH` project here: https://jira.mongodb.org.** |
100 | | - |
101 | | -#### `COMMON-90002` |
102 | | - |
103 | | -Signals usage of a method that is not implemented yet. |
104 | | - |
105 | | -**See the error output for details.** |
106 | | - |
107 | | -## @mongosh/shell-api |
108 | | - |
109 | | -#### `SHAPI-10001` |
110 | | - |
111 | | -Signals calling a method that requires sharding for a collection that is not sharded |
112 | | -or a database that does not have sharding enabled. |
113 | | - |
114 | | -**Solution: Be sure to enable sharding on the database or that the collection is sharded.** |
115 | | - |
116 | | -#### `SHAPI-10002` |
117 | | - |
118 | | -Signals calling a method requiring a replica set without being connected to a replica set. |
119 | | - |
120 | | -**Solution: Make sure you are connected to a replica set.** |
121 | | - |
122 | | -#### `SHAPI-10003` |
123 | | - |
124 | | -Signals calling a method that requires to be connected to a `mongos` instead of just a `mongod`. |
125 | | - |
126 | | -**Solution: Ensure you are connected to a `mongos` instances.** |
127 | | - |
128 | | -#### `SHAPI-10004` |
129 | | - |
130 | | -Signals calling an operation that requires an active database connection without being connected. |
131 | | - |
132 | | -**Solution: Connect to a database before executing the operation.** |
133 | | - |
134 | | -#### `SHAPI-10005` |
135 | | - |
136 | | -Signals calling a method that requires a Mongo object with field-level encryption options |
137 | | -when none were passed. |
138 | | - |
139 | | -**Solution: Create a new Mongo object with the correct field-level encryption options first.** |
0 commit comments