Details
-
Type: Monitor
-
Status: Closed
-
Priority: Major
-
Resolution: Done
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: FIWARE-TECH-HELP
-
Labels:
-
HD-Chapter:Unknown
-
HD-Enabler:Unknown
-
HD-Node:Unknown
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": [
]
},
"notification": {
"http":
},
"throttling": 5
}
Here is what I get in MongoDB collection, attrNames has been made dummy for the question:
{
"_id":
,
"attrNames": [
"a",
"b",
"c",
"d",
"e",
"f",
"g",
"h",
"i",
"j"
],
"attrs": {
"a":
,
"b":
,
"c":
,
"d":
,
"e":
,
"f":
,
"g":
,
"h":
,
"i":
,
"j":
},
"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
Field | Original Value | New Value |
---|---|---|
Component/s | FIWARE-TECH-HELP [ 10278 ] |
HD-Enabler | Unknown [ 10910 ] | |
HD-Chapter | Unknown [ 10845 ] | |
HD-Node | Unknown [ 10852 ] |
Assignee | Andres Muñoz [ andres.munoza ] |
Assignee | Andres Muñoz [ andres.munoza ] | Fernando Lopez [ fla ] |
Status | Open [ 1 ] | In Progress [ 3 ] |
Status | In Progress [ 3 ] | Answered [ 10104 ] |
Resolution | Done [ 10000 ] | |
Status | Answered [ 10104 ] | Closed [ 6 ] |
Transition | Time In Source Status | Execution Times | Last Executer | Last Execution Date | |||||
---|---|---|---|---|---|---|---|---|---|
|
372d 4h 38m | 1 | Fernando Lopez | 02/Mar/23 11:09 AM | |||||
|
2s | 1 | Fernando Lopez | 02/Mar/23 11:09 AM | |||||
|
2s | 1 | Fernando Lopez | 02/Mar/23 11:09 AM |
2022-02-23 05:31|CREATED monitor | # answers= 0, accepted answer= False