could I perform further queries on the result of a previous query? like cast the result to document somehow? I cannot find any mention of it, thanks