Back to main page



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.


    { "$match" : string }

Example 1:


Example 2:

    {"$match":"generic product"}