I have managed to search a string type name inside the dto by using the following query,
@RestResource(path = "searchByName") @Query("{\'$and\': [{