[Backlogmanager] [FIWARE-JIRA] (HELP-19257) [fiware-stackoverflow] How to create different record for every update in FIWARE-Draco?

Andres Muñoz (JIRA) jira-help-desk at jira.fiware.org
Wed Mar 9 13:18:00 CET 2022


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

Andres Muñoz reassigned HELP-19257:
-----------------------------------

    Assignee: Fernando Lopez  (was: Andres Muñoz)

This is not a component that we are  giving support

> [fiware-stackoverflow] How to create different record for every update in FIWARE-Draco?
> ---------------------------------------------------------------------------------------
>
>                 Key: HELP-19257
>                 URL: https://jira.fiware.org/browse/HELP-19257
>             Project: Help-Desk
>          Issue Type: Monitor
>          Components: FIWARE-TECH-HELP
>            Reporter: Backlog Manager
>            Assignee: Fernando Lopez
>              Labels: fiware, fiware-orion, mongodb
>
> Created question in FIWARE Q/A platform on 22-02-2022 at 09:02
> {color: red}Please, ANSWER this question AT{color} https://stackoverflow.com/questions/71218728/how-to-create-different-record-for-every-update-in-fiware-draco
> +Question:+
> How to create different record for every update in FIWARE-Draco?
> +Description:+
> I just started using FIWARE and I'm having trouble with the data I want to persist on MongoDB using Draco. I am using a Python script that creates my context data with a specific id (by a POST request to Orion)  and then updates certain attributes of this data (by a PATCH request to update multiple attributes) by using FIWARE Orion Context Broker.
> While I can't see any problem when I observe the JSON data from this script, HTTP requests and Apache NiFi flow, MongoDB keeps only the last updated version of this data in the related collection. Because of this, I cannot perform time series functions. However I can see the "creDate" and "modDate" metadatas in attributes. But I need different records for every update to receive them.
> Here is te subscription request body from Postman Client. fiware-service and fiware-servicepath headers are also included in my requests:
> {
>   "description": "Notify Draco of all context changes",
>   "subject": {
>     "entities": [
>       {
>         "idPattern": ".*"
>       }
>     ]
>   },
>   "notification": {
>     "http": {
>       "url": "http://hostIP:5050/v2/notify"
>     }
>   },
>   "throttling": 5
> }
> Here is what I get in MongoDB collection, attrNames has been made dummy for the question:
> {
>   "_id": {
>     "id": "urn:ngsi-ld:entitiy:001",
>     "type": "Log",
>     "servicePath": "/"
>   },
>   "attrNames": [
>     "a",
>     "b",
>     "c",
>     "d",
>     "e",
>     "f",
>     "g",
>     "h",
>     "i",
>     "j"
>   ],
>   "attrs": {
>     "a": {
>       "type": "Datetime",
>       "creDate": 1645514416,
>       "modDate": 1645514416,
>       "value": "17/09/2021",
>       "mdNames": []
>     },
>     "b": {
>       "value": "12:00:21.0",
>       "type": "Datetime",
>       "mdNames": [],
>       "creDate": 1645514416,
>       "modDate": 1645514597
>     },
>     "c": {
>       "value": 666.47,
>       "type": "Integer",
>       "mdNames": [],
>       "creDate": 1645514416,
>       "modDate": 1645514640
>     },
>     "d": {
>       "value": 175.55,
>       "type": "Integer",
>       "mdNames": [],
>       "creDate": 1645514416,
>       "modDate": 1645514597
>     },
>     "e": {
>       "value": 24.27,
>       "type": "Integer",
>       "mdNames": [],
>       "creDate": 1645514416,
>       "modDate": 1645514597
>     },
>     "f": {
>       "value": 999.28,
>       "type": "Integer",
>       "mdNames": [],
>       "creDate": 1645514416,
>       "modDate": 1645514597
>     },
>     "g": {
>       "type": "Integer",
>       "creDate": 1645514416,
>       "modDate": 1645514416,
>       "value": 85.87,
>       "mdNames": []
>     },
>     "h": {
>       "type": "Integer",
>       "creDate": 1645514416,
>       "modDate": 1645514416,
>       "value": -0.01,
>       "mdNames": []
>     },
>     "i": {
>       "type": "Integer",
>       "creDate": 1645514416,
>       "modDate": 1645514416,
>       "value": 37.41,
>       "mdNames": []
>     },
>     "j": {
>       "value": 1111.47,
>       "type": "Integer",
>       "mdNames": [],
>       "creDate": 1645514416,
>       "modDate": 1645514640
>     }
>   },
>   "creDate": 1645514416,
>   "modDate": 1645514640,
>   "lastCorrelator": "679e1cba-93b0-11ec-be0f-0242ac120102" 
> I've gone through all the docs but either couldn't find the solution or am I missing something in the architectural logic. How should I go about the issue?
> Thanks!



--
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