Closed alexadusei closed 6 years ago
Looks like .write
returns the write stream, so .then
won't exist on that.
That's a shame. Wonder if there'll any workarounds or alternatives then.
You can turn the stream into a promise by resolving on the done
event and rejecting on error
, which makes it possible to chain promises.
Good suggestion - thanks @paulxuca!
I looked through the documentation and older issues to see if this was addressed, but doesn't seem to be the case.
The documentation states you can have promise-based behaviour with method-chaining as so:
Looks good, until you add a
.write()
in there, like any other method.This gives the following error:
TypeError: xray(...).paginate(...).limit(...).write(...).then is not a function
. Any reason why this is?