added checking of a returned regular JSON document
multi-clause JSON queries no longer do more than one full scan of the database (other clauses are checked iterating over the intermediate result set)