I did not understand this code , which is written within 'awards''

{
$match: {
awards: Won \d{1,2} Oscars?/
}
},

Hi @Kunal_Arya,

This looks like a regex but it’s missing a leading / I think here.

I think it should be /Won \d{1,2} Oscar?/.

\d = digit
{1,2} = 1 or 2 repetitions (=1 or 2 digits here)
? = 0 or 1 (so with or without the trailing s).

You can refer to this cheat sheet: Regular Expressions Cheat Sheet by DaveChild - Download free from Cheatography - Cheatography.com: Cheat Sheets For Every Occasion

Example:

> db.coll.aggregate({ $match: { awards: /Won \d{1,2} Oscar?/ } })
[
  {
    _id: ObjectId("61669a5f2a3dee36cb27283d"),
    awards: 'Won 12 Oscars'
  }
]

This could be a find by the way.

Cheers,
Maxime.