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()[0].stringKey();
document.fieldset('image').entries()[0].stringKey();

Querying comments

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

document.field('author').requiredStringComment();
document.fieldset('image').optionalStringComment();

Next page: Predefined Types