Queries on arrays and hashes