To simplify the development and debugging of FerretDB, we support different operation modes. Operation modes specify how FerretDB handles incoming requests. They are useful for testing, debugging, or bug reporting.
You can specify modes by using the
--mode flag or
which accept following types of values:
By default FerretDB always run on
normal mode, which means that all client requests
are processed only by FerretDB and returned to the client.
Proxy is another MongoDB-compatible database, accessible from the machine.
You can specify its connection URL with
--proxy-addr flag or with the
To forward all requests to proxy and return them to the client, use
proxy operation mode.
Diff modes (
diff-proxy) forward requests to both databases, and log the difference between them.
diff-normal afterwards returns the response from FerretDB and
diff-proxy - from the specified proxy handler.
Example diff output:
--- res header
+++ proxy header
@@ -1 +1 @@
-length: 87, id: 3, response_to: 69, opcode: OP_MSG
+length: 87, id: 645, response_to: 69, opcode: OP_MSG
--- res body
+++ proxy body
@@ -14,4 +14,4 @@
- "size": 0,
- "numObjects": 0,
+ "size": 93,
+ "numObjects": 3,