[Backlogmanager] [FIWARE-JIRA] (HELP-16164) [fiware-stackoverflow] How to add TimeInstant, CreationDate and ModifiedDate into CrateDB with Orion Context Broker?

Fernando Lopez (JIRA) jira-help-desk at jira.fiware.org
Mon Sep 23 10:46:00 CEST 2019


     [ https://jira.fiware.org/browse/HELP-16164?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Fernando Lopez reassigned HELP-16164:
-------------------------------------

    Assignee: MARTEL

> [fiware-stackoverflow] How to add TimeInstant, CreationDate and ModifiedDate into CrateDB with Orion Context Broker?
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: HELP-16164
>                 URL: https://jira.fiware.org/browse/HELP-16164
>             Project: Help-Desk
>          Issue Type: Monitor
>          Components: FIWARE-TECH-HELP
>            Reporter: Backlog Manager
>            Assignee: MARTEL
>              Labels: cratedb, fiware, fiware-orion
>
> Created question in FIWARE Q/A platform on 18-09-2019 at 10:09
> {color: red}Please, ANSWER this question AT{color} https://stackoverflow.com/questions/57987944/how-to-add-timeinstant-creationdate-and-modifieddate-into-cratedb-with-orion-co
> +Question:+
> How to add TimeInstant, CreationDate and ModifiedDate into CrateDB with Orion Context Broker?
> +Description:+
> I'm setting up a Firmware-Framework, where I unforutunately have to add historically Sensor Values. But I also need the creationDate and the modificationDate for other usecases.  
> Therefore I add the Attribute "Metadata" with the variable "TimeInstant". Then I create an Entity, create an Orion-Subscription for that Entity and update the Entity with my old Sensor-Valses. 
> The Json-File I send to the Orion-Context Broker to update the Attribute looks like this: 
> {
> "metadata": {
>     "TimeInstant": {
>         "type": "DateTime",
>         "value": "2015-02-02T11:35:25.0000Z"
>     }
> },
> "type": "Number",
> "value": 0.0132361 }
> The Output in my Mongo-DB like this: 
> "_id": {
>     "id": "urn:ngsi-ld:SensorB-K1200____",
>     "type": "Sensor",
>     "servicePath": "/test/servicepath"
> },
> "attrNames": [
>     "Sensor_value"
> ],
> "attrs": {
>     "Sensor_value": {
>         "value": 0.01632361,
>         "type": "Number",
>         "md": {
>             "TimeInstant": {
>                 "type": "DateTime",
>                 "value": 1422876989
>             }
>         },
>         "mdNames": [
>             "TimeInstant"
>         ],
>         "creDate": 1568712813,
>         "modDate": 1568735930
>     }
> },
> "creDate": 1568712813,
> "modDate": 1568735930,
> "lastCorrelator": "0a129232-d964-11e9-8e5a-0242ac130009" }
> But my Crate-DB only has the columns:
> entity_id   entity_type fiware_servicepath  sensor_value    time_index 
> My Subscription File looks like this:
> {
> "expires": "2019-12-24T18:00:00",
> "notification": {
>     "http": {
>         "url": "http://quantumleap:8668/v2/notify"
>     },
>     "metadata": [
>         "dateCreated",
>         "dateModified",
>         "TimeInstant"
>     ]
> },
> "subject": {
>     "entities": [
>         {
>             "id": "urn:ngsi-ld:SensorB-K1200____",
>             "type": "Sensor"
>         }
>     ]
> },
> "throttling": 0 }
> I've tried changing the "Metadata" Attributes in the Subscription-File, also tried restartig Crate-DB, ContextBroker e.g.. 
> I excpect the CrateDb to show all three values: "dateCreated", "dateModified" and "TimeInstant".



--
This message was sent by Atlassian JIRA
(v6.4.1#64016)


More information about the Backlogmanager mailing list

You can get more information about our cookies and privacy policies clicking on the following links: Privacy policy   Cookies policy