Navigation Menu

Skip to content

Commit

Permalink
regex match operator for string fields
Browse files Browse the repository at this point in the history
  • Loading branch information
jliszka committed Dec 19, 2011
1 parent 125ca03 commit 091c2d5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/scala/com/foursquare/rogue/QueryField.scala
Expand Up @@ -13,6 +13,7 @@ import net.liftweb.record._
import net.liftweb.mongodb.record.field.{BsonRecordField, BsonRecordListField, MongoCaseClassField, MongoCaseClassListField}
import org.bson.types.ObjectId
import org.joda.time._
import scala.util.matching.Regex

object CondOps extends Enumeration(0, "$ne", "$lt", "$gt", "$lte", "$gte",
"$in", "$nin", "$near", "$all", "$size",
Expand Down Expand Up @@ -198,7 +199,7 @@ class StringQueryField[M <: MongoRecord[M]](val field: Field[String, M]) {
new EqClause(field.name, p) {
override lazy val actualIndexBehavior = IndexBehavior.DocumentScan
}

def matches(r: Regex) = matches(r.pattern)
def regexWarningNotIndexed(p: Pattern) = new EqClause(field.name, p)
}

Expand Down

0 comments on commit 091c2d5

Please sign in to comment.