Created
November 6, 2011 22:22
-
-
Save bwmcadams/1343659 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
implicit def kvPairAsDBObject[A <: Any](kv: (String, A)): DBObject = MongoDBObject(kv) | |
sealed class NestedListOper(outerField: String) { | |
def apply[A <% DBObject](fields: A*): DBObject = { | |
val b = Seq.newBuilder[DBObject] | |
fields.foreach(x => b += x) | |
MongoDBObject(outerField -> b.result()) | |
} | |
} | |
trait OrOp extends BarewordQueryOperator { | |
/* def $or[A : ValidBarewordExpressionArgType](fields: A*) = | |
MongoDBObject("$or" -> implicitly[ValidBarewordExpressionArgType[A]].listify(fields))*/ | |
def $or = new NestedListOper("$or") | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment