Better error if non-doc passed to documentMatches