Hay i actually running command for matching text with regex at aggregate, i have tested at mongo shell and working but with reactivemongo api command match result not working
val commandDoc = BSONDocument(
"aggregate" -> "posts",
"pipeline" -> BSONArray(
BSONDocument("$unwind" -> "$keywords"),
BSONDocument("$match" -> BSONDocument("keywords" -> BSONDocument("$regex" -> filter, "$options" -> "i"))),
BSONDocument("$group" -> BSONDocument("_id" -> "$keywords")),
BSONDocument("$limit" -> (offset + limit)),
BSONDocument("$skip" -> offset),
BSONDocument("$sort" -> BSONDocument("keywords" -> sortValue))
)
)
val runner = Command.run(BSONSerializationPack)
runner.apply(reactiveMongoApi.db, runner.rawCommand(commandDoc)).one[JsObject].map {... }
Thanks, for help