I have some attributes with a common section like , productDescription, warrantyDescription, collectionDescripion …
how can I search all of these attributes ? I want to know how many field have “Description” in their name…
I would fire up Compass and run Analyse Schema from the Schema tab.
If that is not satisfying. My approach would be:
- a $project stage with $objectToArray
- an $unwind stage on the result of the above
- a $match stage with a $regex to keep /Description/
- a $group stage with a $sum or $first
Hi @nahid_musavi, could you please follow up on this. If my post help you achieve your goal, please let us know and mark my post as the solution. This is as courtesy to all to make this forum efficient and helpful.