Understanding query results in JSON arrays