Closed gayanhewa closed 6 years ago
We made an update recently to support function (req, res, next)
signatures.
The req
object should have all the same expected properties as the hook
object.
hook
also contains hook.req
and hook.res
. They should all be equivalent.
hook.req.params
is not equivalent to hook.params
. Those are two separate scopes.
Documentation and example usage for the datastore can be found here: http://hook.io/datastore
Thanks @Marak , I couldn't find a way to do a getAll documents. Is this not supported?
For performance reasons, there is no way to get all documents.
I am currently trying to use the service that uses the data store.
Is there a global variable
hook
that gives me access to the store?Or do I always have to follow the pattern of replacing
module['exports'] = function myService(req, res, next) {
with
module['exports'] = function myService(hook) {
And access the data store via
hook.datastore
?When I opt to do the latter, some of the parameters submitted are not available trough
hook.req.params