TOOLS-495: query.js relies on ordering of nested document