Regex on arrays

23 views
Skip to first unread message

Yuval Sapir

unread,
Jul 14, 2020, 11:58:56 AM7/14/20
to kmongo
Hi.
I'm trying to run a regex query against the items on an embedded array (I have an index on that field), but it seems the regex filter only works on String properties.
Is it possible to add similar methods for string iterables? Something along the lines of:

infix fun KProperty<Iterable<String?>>.regex(regex: Regex): Bson = Filters.regex(path(), regex.toPattern())

etc. ?

Thanks,
  Yuval Sapir

zigzago

unread,
Jul 15, 2020, 2:04:47 AM7/15/20
to kmongo
Hi,

The issue is created https://github.com/Litote/kmongo/issues/215 I will commit the fix today or tomorrow.

Regards

Julien
Reply all
Reply to author
Forward
0 new messages