Back to main page

$match

Concept:

Match is used to do text search operations. For example: {"$match": "great programmers"} will match fields "Bob is a greater programmer!", "Programmers are having great fun", when the field is properly analyzed with the English analyzer. The matched text is split to tokens with the analyzer specified for the field in schema. E.g. with English analyzer "great programmers" is turned into terms 'great' and 'programmer'. The correct matches, like "Bob is a greater programmer", must contain both 'great' and 'programmer terms in some valid form. E.g. 'programmers' will match the 'programmer' in the query.

Format:

    { "$match" : string }

Example 1:

    {"$match":"laptop"}

Example 2:

    {"$match":"generic product"}