JSON nested objects
Objects can be nested inside other objects. Each nested object must have a unique access path.
The same field name can occur in nested objects in the same document. However, the full access name must still be unique.
Examples
To access nested fields, concatenate the field names with a "." (dot) as separator. For example,
use
author.lastname
to access the surname for the author in this document:
{"isbn": "123-456-222",
"author":
{
"lastname": "Doe",
"firstname": "Jane"
},
"editor":
{
"lastname": "Smith",
"firstname": "Jane"
},
"title": "The Ultimate Database Study Guide",
"category": ["Non-Fiction", "Technology"]
}
In the example, the field name lastname
occurs in the
author
and the editor
object. The prefixes in
author.lastname
and editor.lastname
provide unique access.