How to implement and use search tokens for efficient text search in MongoDB
searchTokens
field to your schema:
searchTokens
field in your repository:
getSearchQueryForTokens
function converts search terms into MongoDB queriesshortenMongoId
to include readable portions of IDsgetSearchTokens
isEqual
to avoid unnecessary updates