dbg()
Output a message in the query response and return the message.
Description
The dbg()
method outputs message in the query response
summary
field and returns message. It includes a preview of the
calling location.
The message template is:
info: <message>
at *<source>*:<line>:<column>
|
<line> | dbg(<message>)
| ^^^^^^^^^^^
|
where:
Field | Description | ||||||
---|---|---|---|---|---|---|---|
|
Message source.
|
||||||
|
Line number where |
||||||
|
Character offset in |
||||||
|
String-serialized |
Examples
-
Output a composed value in the query response:
{ name: "debug1", coll: Collection, ts: Time("2022-12-22T00:24:43.580Z"), history_days: 6 } Summary: info: 6 at *query*:3:20 | 3 | history_days: dbg(1 + 2 + 3), | ^^^^^^^^^^^ |
-
Output a collection definition object:
{ name: "debug2", coll: Collection, ts: Time("2022-12-22T00:24:43.660Z"), history_days: 6 } Summary: info: {name: debug2, history_days: 6} at *query*:2:6 | 2 | dbg({ | ______^ 3 | | name: "debug2", 4 | | history_days: 1 + 2 + 3, 5 | | }) | |____^ |
-
Output the result of creating a collection:
{ name: "debug3", coll: Collection, ts: Time("2022-12-22T00:24:14.560Z"), history_days: 6 } Summary: info: [doc {TODO: render doc fields}] at *query*:1:4 | 1 | dbg( | ____^ 2 | | Collection.create({ 3 | | name: "debug3", 4 | | history_days: 1 + 2 + 3, 5 | | }) 6 | | ) | |_^ |
Is this article helpful?
Tell Fauna how the article can be improved:
Visit Fauna's forums
or email docs@fauna.com
Thank you for your feedback!