Persist a set of variables with SwiftData

Hi! I'm creating a document based app using DocumentGroup. I want to make persistent a set of variables that represent a certain setup of the document.

I have followed the example in https://developers.apple.com/videos/play/wwdc2023/10154. If I want to implement a set of variables that define for instance the color background of a set of flashcards. How can I do it? I cannot use @Query because these set of variables is not an array. I cannot use userDefaults either because I want this set of variables to be bonded to the document and not to my application.

Thank you very much for the help!

Persist a set of variables with SwiftData
 
 
Q