is there a way to query collections with wildcard on attributes (keys)?
If we have the collection below, and I would like to retrieve all entries having attributes with a key containing “_address”, would there be any way to achieve this in a query?:
One of the advantages is that the sub-document schema is consistent. This helps when coding. For example, the same simpler code can be used to print an address. Otherwise you need logic to determine if you want to access the field business_address or personal_address. This also helps reduce the number of indexes since the fields have the same name. Otherwise you need an index for business_address and one for personal_address.