Uploaded image for project: 'Help-Desk'
  1. Help-Desk
  2. HELP-19257

[fiware-stackoverflow] How to create different record for every update in FIWARE-Draco?

    Details

      Description

      Created question in FIWARE Q/A platform on 22-02-2022 at 09:02
      Please, ANSWER this question AT 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!

        Activity

        Hide
        backlogmanager Backlog Manager added a comment -

        2022-02-23 05:31|CREATED monitor | # answers= 0, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2022-02-23 05:31|CREATED monitor | # answers= 0, accepted answer= False
        Hide
        andres.munoza Andres Muñoz added a comment -

        This is not a component that we are giving support.

        Show
        andres.munoza Andres Muñoz added a comment - This is not a component that we are giving support.
        Hide
        andres.munoza Andres Muñoz added a comment -

        This is not a component that we are giving support

        Show
        andres.munoza Andres Muñoz added a comment - This is not a component that we are giving support

          People

          • Assignee:
            fla Fernando Lopez
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: