Please can someone provide an example of using the $db.get method to read tickets, or other data within a "server.js" function. I am trying to perform the equivalent of
client.data.get("loggedInUser")
to get the identity of the Agent initiating the request.
From the documentation, it appears this information is available to event handlers, as 3 parameters are supplied (iparams, requester, and data), but invoked handlers are only provided with 2 parameters.
[Note: All requests using the $db.get method result in "Record not found" errors, and the examples provided are associated with event handling where the loggedInUser is passed into the event handler function.]