{"version":"1.0","type":"rich","title":"Gist 370577","description":"This example demonstrates a Scala program that interacts with MongoDB through the Casbah MongoDB Scala driver, showing how to define a case class `User` with fields like `id`, `name`, and optional `age`, then insert 50 randomly generated users into a collection. It queries users using the `User` shape's `where` clauses (e.g., `User.age is_> 50`), sorts them by age, and deletes users outside a specified age range. The code also shows inserting a raw `Map` directly into a collection and uses for-comprehensions to iterate over query results, highlighting the driver’s Scala-specific query and collection APIs.","provider_name":"VizHub AI Studio","provider_url":"https://next.vizhub.com","html":"<iframe src=\"https://next.vizhub.com/viz/gist-370577?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"1\"></iframe>","width":960,"height":500,"cache_age":3600}