title: Casbah Mongo as scala Array: is this the most elegant way?
body: <p>Folks, </p>
  
  <p>Is this the most elegant way to get a scala List out of casbah?</p>
  
  <p><code>trains</code> is a subkey in a doc whose value is an array</p>
  
  <p>I was slightly surprised that I had to do the <code>instanceOf</code> and then the <code>asScala</code> to get a first class scala list</p>
  
  <p>Could I have done anything better or more idiomatically scala?</p>
  
  <pre><code>val mongoconn = MongoConnection("titan"){"traininfo"}{"trains"}
      val result = mongoconn.find()
      println()
  
  
      for{
        x&lt;-result.toList
        y&lt;-(x.get("trains").asInstanceOf[BasicDBList]).asScala
  
      }
      {
        println(y);
      }
  </code></pre>