MongoDB Playground β

Changelog | Support

Aggregation Pipeline
2 {"$group": {"_id": "$articulo","stock": {"$sum": "$cantidad"}}}
[
  {
    "_id": "lapiz",
    "stock": 32
  },
  {
    "_id": "goma",
    "stock": 4
  }
]
Collection