MongoDB: don't call cursor.hasNext() unnecessarily to support isEmpty()