Skip to content

Example using references in a field schema #435

Answered by dev-embedthis
meadoch1 asked this question in Q&A
Discussion options

You must be logged in to vote

Yes. But you and some do, use it in code to understand the "owner" of an item.

For example:

        Device: {
            pk:             { type: 'string', value: 'd#${id}' },
            sk:             { type: 'string', value: 'd#' },

            gs1pk:          { type: 'string', value: 'd#${productId}' },
            gs1sk:          { type: 'string', value: 'd#${id}' },

            id:             { type: 'string', required: true, encode: ['pk', '#', 1] },
            cloudId:        { type: 'string', map: 'cl', reference: 'Cloud:primary:id=cloudId'  },
            productId:      { type: 'string', map: 'pr', reference: 'Product:primary:id=productId'  },
            model:          {…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@meadoch1
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by dev-embedthis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants