Last active
January 1, 2016 04:59
-
-
Save fcroiseaux/8095387 to your computer and use it in GitHub Desktop.
Regexp not working with ReactiveMongo ?
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
// Cette requête retourne bien l'enregistrement | |
val cursor: Cursor[JsObject] = connections. | |
find(BSONDocument("lastName" -> BSONString(mask))). | |
cursor[JsObject] | |
// Celle ci ne retourne rien ? | |
val cursor: Cursor[JsObject] = connections. | |
find(BSONDocument("lastName" -> BSONRegex("/"+mask+"/", "i"))). | |
cursor[JsObject] | |
// Celle ci non plus | |
val cursor: Cursor[JsObject] = connections. | |
find(BSONDocument("lastName" -> BSONString("/"+mask+"/"))). | |
cursor[JsObject] | |
// Je ne sais pas si c'est lié mais sur le prompt mongo | |
// Ceci fonctionne : | |
db["connections"].find({lastName: /auph/}) | |
// et ceci pas : | |
db["connections"].find({lastName: "/auph/"}) |
sgodbillon
commented
Dec 23, 2013
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment