update DocumentRepository to use where expression only when not null

This allows the document repository to be used directly with the selectable adapter when you dont set any where expression.