score:2
Accepted answer
you can build a regex. i don't have my environment up to test it, but this should help you get on track:
import com.mongodb._
val regex = languagecodefilter map ( l => s"(?:.*\\q$l\\e.*)" ) mkstring "|" r
val query = querybuilder.start("languagecode").regex(regex).get
Source: stackoverflow.com
Related Query
- How do I write a query for mongodb using the casbah driver for scala that uses a substring and checks if the field is in a list of supplied values?
- How can I view the code that Scala uses to automatically generate the apply function for case classes?
- How to read and write from MongoDb using two different drivers (MongoDB Scala Driver and Salat)
- How to write this for iteration in scala without using the For( loop; if condition) and still use yield properlly
- How do write a date range query in mongodb using reactive mongo in scala
- How to write a toCSV method for scala case class that would generate the csv string for the class?
- How to make $filter operator inside a projection of an aggregation using the MongoDB Scala Driver
- How do I write a JSON Format for an object in the Java library that doesn't have an apply method?
- How to have a Scala standalone application that uses the playframework libraries
- What is the syntax for creating a Map in Scala that uses an enum as a key?
- How to make synchronous queries using MongoDb Scala driver
- Scala - how to get the 'type' for a field using reflection api
- What's the best way using Scala and SBT to create samples for a library that can be built from the SBT CLI?
- how to write insert query for table that contains reference column to another table in play-slick with scala?
- How to Find the maximum consecutive years for each ID using Scala / Spark
- How to make the 'public' schema default in a Scala Play project that uses PostgreSQL?
- how can I write a function in scala called Order that takes one arguement: a list of Ints. And returns the same List of Ints from least to greatest
- How can I decrease the memory heap for my scala project using Sbt?
- How do I get all the keys that are stored in the Cassandra 2.0.1 column family with scala using hector?
- Not Sure How to Write the Implicit for Equality Using Scalaz
- How to debug permgen memory errors for a project that uses sbt and play 2 framework in Scala
- How does one write a scala unit test for the "filter" function?
- The MongoDB Scala binding Casbah query DSL acts strangely with $regex
- How to reflect concrete return types for methods of classes defined at runtime using the Scala ToolBox?
- How to redirect Apache Spark logs from the driver and the slaves to the console of the machine that launchs the Spark job using log4j?
- How to accumulate aggregation results into a collection using MongoDB Scala Driver
- i have wriiten a logout code in welcome.scala.html page but getting errors in that page how can i write the code for it
- How to write a Restful client using the same Interface defined for the server
- How do I write a generic JSON parser in Play 2.7 for Scala that validates inbound requests?
- How do I write a script in Scala that converts the current time to the number of seconds since midnight?
More Query from same tag
- Scala REPL truncates the output
- Text File of specific format into DataFrame in Spark using Scala
- Converting Seq[T] into Option[Seq[T]]
- Add identical rows to a Spark Dataframe using an integer
- How to modify Iterator on the fly without mutable variables?
- Performance of multiple generators in Scala 'for' expressions?
- Howto create a generic type class function using functors
- Scala call lambda from map
- Default set of kryo registrations for spark/scala
- Doesn't work debug for play project in IDEA 14 Ultimate
- Generify String Implementation in Subclasses
- How to handle Future[Option[BSONDocument] in Play action
- Using multiple Scala TypeClass instances in function parameters
- Use Scala to unit test Java?
- Meaning of -= and += in Scala Trait definition
- How to convert an imperative double for-loop to functional style without return in Scala?
- Apache Spark Mongo-Hadoop Connector class not found
- make a list of right adjusted Strings using space as the padding character
- Polymorphic lift-json deserialization in a composed class
- How to fix my implementation of partial sums in Scala?
- Creating some random case class dynamically using List[Strings] or Array[Strings]
- Remove Option from result
- Impossible to import koalas in scala notebook
- Calling Scala constructor with multiple argument lists
- Wait until all Future.onComplete callbacks are executed
- Missing parameter type for expanded function in Scala ArrayBuffer
- How to mimic constructor arguments in a scala trait?
- Upgrading Play to 2.4, Slick to 3.1.1, value withTransaction is not a member of play.api.db.slick.Database
- Find first null value of an Array[Int]
- lazy loading some config params, trying to come up with a pattern in Scala