Fiware orion 如何删除或编辑实体orion上下文代理
我们在Orion上下文代理中创建了一个实体,需要添加一个属性标记。结构类似于:Fiware orion 如何删除或编辑实体orion上下文代理,fiware-orion,Fiware Orion,我们在Orion上下文代理中创建了一个实体,需要添加一个属性标记。结构类似于: <?xml version="1.0" encoding="UTF-8"?> <updateContextRequest> <contextElementList> <contextElement> <entityId type="entity_id" isPattern="false"> <id>enti
<?xml version="1.0" encoding="UTF-8"?>
<updateContextRequest>
<contextElementList>
<contextElement>
<entityId type="entity_id" isPattern="false">
<id>entity_id</id>
</entityId>
<contextAttributeList>
<contextAttribute>
<name>param1_name</name>
<type>param1_type</type>
<contextValue>param1_</contextValue>
</contextAttribute>
<contextAttribute>
<name>param2_name</name>
<type>param2_type</type>
<contextValue>param2_value</contextValue>
</contextAttribute>
</contextAttributeList>
</contextElement>
</contextElementList>
<updateAction>APPEND</updateAction>
</updateContextRequest>
我们需要删除实体并使用新属性重新创建它,或者您可以添加属性而不必删除它
如何删除和编辑它?如果可能,请编辑
问候,,
Ismael如果要更改与实体关联的属性,则无需删除并重新创建实体。Orion用户手册中关于的部分解释了如何动态删除现有实体的属性并将其添加到现有实体中 关于实体ID和类型,它们是不可变的字段。它们是实体定义的本质部分,因此更改它们等于销毁实体并再次创建它。用户手册中的章节介绍了实体删除
最后,当前版本的Orion 0.18.1不允许更改一个实体所属的服务和/或服务路径,但将来可能会对API进行改进以允许更改。我需要编辑entityId类型标记,从到。如何编辑它?按照本手册,我们尝试以下操作:mongo localhost/entities>db.entities.remove{{u id.id:finesce\u meteo,{u id.type:}但是当我们尝试列出所有创建的实体时,finesce_meteo实体仍然在这里:curl localhost:1026/ngsi10/contextenties/finesce_meteo-s-s-header'Content Type:application/xml'| xmllint-format-Deleting-at-DB是其中一种机制。如果使用Orion 0.11.0或更高版本,您也可以通过API来完成,如上述手册部分所述。