1
votes

I need to make an updateContext of an attribute with a known value but with an unknown type. If we could avoid querying the entity first, it would be great. Is there some way of updating an attribute without knowing its type in advance?

1

1 Answers

0
votes

It depends on Orion version. Before 0.17.0, the attribute type was used as part of the attribute identification (along with the attribute name). Thus, you needed to know the attribute type in advance in order to update it in a "safe" way (you could use empty type, which means "any type", but at the risk that other attribute with the same name got unintentionally updated).

However, from 0.17.0 on only the attribute name is used for attribute identification. Thus, you don't need to specify the type in attribute updates. Basically:

  • If the update includes name, type and value, both the type and value get updated
  • If the update includes name and value (but not type), the value gets updated. The type is left untouched.