Keys and Comments

Querying keys

All elements have a key (list items return the key of the list) therefore you don't need to specify optional/required here:

document.elements.first.string_key
document.fieldset('image').entries.first.string_key

Querying comments

All elements can have an associated comment and like with values you specify whether it's optional or required:

document.field('author').required_string_comment
document.fieldset('image').optional_string_comment

Next page: Predefined Types