Fix query for single-document datasets.