I noticed it’s not possible to use a command to add data to a collection with a sub-collection straight away. Instead I should use a second command to add data to the sub-collection.
Why is this not possible? Or what am I doing wrong?
Example (warning: with pseudo-code!):
'Orders': collection ['Order'] {
'Order': text
'Order line': collection ['Line'] {
'Line': text
}
}
'Add order': command {
'Order': text
'Order line': collection ['Line'] {
'Line': text
}
} => update .'Orders' = create (
'Order' = @ .'Order'
'Order line' = @ .'Order line' as $ ( //pseudo-code!
'Line' = $ .'Line' //pseudo-code!
) //pseudo-code!
)