Records in the data store can be updated with new assignments for standard attributes and managed values.
The ingestRecords operation, when used with the addAssignments element, lets you update existing records in the data store by adding standard attribute values and/or managed values. The element can also create a standard or managed attribute if the attribute to be added does not exist. In this case, it is added with the defaults listed in Default values for new attributes in the data store.
You can assign multiple values from a given standard attribute only if the attribute is configured as a multi-assign standard attribute. That means that the PDR for the standard attribute has the mdex-property_IsSingleAssign property set to true. If the addAssignments list attempts to assign multiple values to a standard attribute that does not accept multiple values, an error is signaled.
Managed values can be added to records even if the managed attribute to which they belong does not exist in the data store. In this case, the Data Ingest Web Service automatically creates the managed attribute.
<ingest:ingestRecords xmlns:ingest="http://www.endeca.com/MDEX/ingest/1/0" xmlns:mdex="http://www.endeca.com/MDEX/XQuery/2009/09"> <ingest:addAssignments> <mdex:record> <primaryKeyProp>keyValue</primaryKeyProp> <propToAdd>keyValue</propToAdd> <!-- Other property assignments --> </mdex:record> </ingest:ingest:addAssignments> </ingest:ingestRecords>
<ingest:ingestRecords xmlns:ingest="http://www.endeca.com/MDEX/ingest/1/0" xmlns:mdex="http://www.endeca.com/MDEX/XQuery/2009/09"> <ingest:addAssignments> <mdex:record> <partID>P123</partID> <color>yellow</color> <price>18.99</price> <numInStock type="mdex:int">10</numInStock> <Style>4</Style> </mdex:record> </ingest:addAssignments> </ingest:ingestRecords>
Note that the Dgraph process property type of the numInStock standard attribute is specified, because the standard attribute does not exist and therefore will be created as part of the request. The other standard attributes and the Style managed attribute already exist in the data store.