Apply regex on object keys

Hello,

I am applying regex on an object whose values are dynamic.
So how can we do regex checking on all the values of a object.
Every document have category but keys can vary in each documents.

Let say

category : { name: 'toys', color: 'red' }
category : { name: 'games',  type:'pc', action:true }
}

Could you expand the question/example please?

What is the regex and what do you want to apply it to? In the two sample documents you included, what do you want to match?

Asya

1 Like