updated getDocumentsByPage to accept dbQuery