I tried with regexp method.
I used this code to get the records which contains substring, but this is not working.
$regex: `/${substring}/g`
And I tried to create index on client side to use fullText statement.
But on cloud function side, if I use query.fullText(), it returns an exception and the exception is below.
{"ok":0,"code":27,"codeName":"IndexNotFound","name":"MongoError"}