JSON/q

A JSON-based data access specification

Arguments

[
  [
    "blueberry", 
    "chimpanzee", 
    "abacus", 
    "banana", 
    "apple", 
    "cheese"
  ]
]

Query

{
  "group": {
    "into": "g", 
    "by": "w[0]"
  }, 
  "as": "w", 
  "from": "args[0]", 
  "select": {
    "firstLetter": "g.key", 
    "words": "g"
  }
}

Results

[
  {
    "firstLetter": "a", 
    "words": [
      "abacus", 
      "apple"
    ]
  }, 
  {
    "firstLetter": "b", 
    "words": [
      "blueberry", 
      "banana"
    ]
  }, 
  {
    "firstLetter": "c", 
    "words": [
      "chimpanzee", 
      "cheese"
    ]
  }
]