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:
info: 6 at *query*:3:16 | 3 | quantity: dbg(1 + 2 + 3), | ^^^^^^^^^^^ | { id: "394873023799230528", coll: Product, ts: Time("2099-04-11T12:38:31.050Z"), name: "debug1", quantity: 6 }
-
Output a Struct:
info: { name: "debug2", quantity: 6 } at *query*:2:6 | 2 | dbg({ | ______^ 3 | | name: "debug2", 4 | | quantity: 1 + 2 + 3 5 | | }) | |____^ | { id: "394873104675897408", coll: Product, ts: Time("2099-04-11T12:39:48.180Z"), name: "debug2", quantity: 6 }
-
Output a Document:
info: { id: ID("394873211262599234"), coll: Product, ts: TransactionTime(), name: "debug3", quantity: 6 } at *query*:1:4 | 1 | dbg( | ____^ 2 | | Product.create({ 3 | | name: "debug3", 4 | | quantity: 1 + 2 + 3, 5 | | }) 6 | | ) | |_^ | { id: "394873211262599234", coll: Product, ts: Time("2099-04-11T12:41:29.835Z"), name: "debug3", quantity: 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!