subset
subset copied to clipboard
Tuple2 Reader
It seems that tuple2Getter does not work correctly:
val coll = db.getCollection("Tuple2Test")
val anyDoc = new BasicDBObject
coll.remove(anyDoc)
val tuple = (1,"a")
val tupleField = "tuple".fieldOf[(Int,String)]
coll.insert(tupleField(tuple))
val tupleBack = coll.findOne(anyDoc)
println(tupleBack) // ok
tupleBack match {
case tupleField(x) => println(x) // failure
}
with the failure: scala.MatchError: [ 1 , "a"](of class com.mongodb.BasicDBList).
To fix it you'll possibly need to add/replace pattern matching against BasicBSONList but I'm not sure how.
Thanks Peter