Can mongoDB do relevance scores for arrays of strings (e.g. $in)? Or do you need elasticsearch?

For instance, can I do an $in query on a property holding an array of strings (e.g. userIds ) and sort results by documents with the most matching strings? At this point, the vanilla $in will just return any documents with a matching string from $in… but I don’t see anything in the docs about relevance or sorting by this (aside form adding a sort for another field like createdAt).

Are mongo $text searches the only area you can do things with relevance like $textScore or weighting?