Nesting data is an artifact of how data is stored in a document database — the physical data model. Translating that to a logical data model requires you to reorient how you think about the data in terms of relationships rather than "nesting." However you choose to document your logical data model, remember that you are describing relationships between data, and nesting is a kind of relationship. To me, nesting implies ownership. Given that nested data structures are "owned" by their parent structure, I would recommend a UML class diagram showing the aggregate associations.
UML aggregate associations come in two main flavors. One implies "ownership" and the other doesn't. The diamond shape is used to denote which entity has the relationship. A diamond with a solid fill color would probably be most useful in your case, because this shape claims that one entity "owns" another. This is the closest I can think of to a "nested" relationship.
For example, say your "Customer" document is in this structure:
{
"FirstName": "...",
"LastName": "...",
"Email": "...",
"Purchases": [
{ ... },
{ ... },
{ ... }
]
}
The relationship between the parent entity "Customer" and the nested collection "Purchases" could look like this in a UML diagram:
![UML diagram showing an aggregate relationship between customer and purchases using a solid fill diamond to denote the nested relationship.](https://cdn.statically.io/img/i.sstatic.net/2FeJZ.png)
The 1..*
notation under the line between the two entities can indicate the multiplicity of that relationship. In this case, 1 customer can have zero or more purchases. The diamond shape is resting against the "Customer" entity, because that is the entity that contains the nested purchases.
For other cases where your data structure only has one object being nested, e.g.
{
"Person": {
"Name": "...",
...
},
...
}
You would still use the solid fill diamond, but change the multiplicity to indicate that only one "Person" is nested: 1..1
. This sort of notation might make the nesting less obvious, but it would translate easier to an object oriented model.
To help clarify the meanings, consider adding a Key to your diagram to describe what this notation means for a document database.