Closed ramanan82 closed 5 years ago
Is the actual regex supposed to be \w
or \\w
? If it is the latter, try escaping both backslashes, i.e: \\\\w
?
Thanks for the response, @jeroen
I actually enjoy mongolite
a lot.
The actual regex is \w
only, which corresponds to \\w
in my R code. The same works in collection$find()
query, as I stated in my earlier comment.
And just for the sake of it, I tried escaping both backslashes, too... As in \\\\w
in the R code.
I have managed to get it working after updating to the latest version of mongolite (2.0). It now shows the error generated by the backend. Basically, I had to give an $options
field inside the regex. It works now!
I have tried the equivalent in other client libraries (pymongo in python), and it works fine. However, when I try the following in mongolite, it returns a blank document; in fact, the query does not even go through to the server, as I have closely seen the logs:
In R, I tried
which results in:
However, the regex
"\\w+"
works fine in a regularcollection$find()
query.