Details
-
Type: Monitor
-
Status: Closed
-
Priority: Major
-
Resolution: Done
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: FIWARE-TECH-HELP
-
Labels:
Description
Created question in FIWARE Q/A platform on 03-03-2022 at 13:03
Please, ANSWER this question AT https://stackoverflow.com/questions/71338124/multiple-entities-cant-be-saved-at-same-time-in-mongo-historical-database
Question:
Multiple entities can't be saved at same time in Mongo historical database
Description:
I am trying to save multiple data entities in historical database, but only the first one from the array is saved in Mongo historical database.
Below are the steps I performed.
Docker-compose for Cygnus:
version: "3.8"
services:
cygnus:
hostname: cygnus
container_name: cygnus
image: fiware/cygnus-ngsi:2.16.0
networks:
- default_config
ports: - "5080:5080"
- "5051:5051"
expose: - "5051"
- "5080"
environment: - CYGNUS_MONGO_SERVICE_PORT=5051
- CYGNUS_MONGO_HOSTS=mongo_db:27017
- CYGNUS_MONGO_USER=root
- CYGNUS_MONGO_PASS=root
- CYGNUS_MONGO_AUTH_SOURCE=admin
- CYGNUS_MONGO_DATA_MODEL=dm-by-service-path
- CYGNUS_MONGO_ATTR_PERSISTENCE=column
- CYGNUS_SERVICE_PORT=5051
- CYGNUS_API_PORT=5080
- CYGNUS_LOG_LEVEL=DEBUG
- CYGNUS_ORION_HOST=orion
- CYGNUS_ORION_PORT=1026
- CYGNUS_ORION_SSL=true
networks:
default_config:
external: true
Create a Cygnus subscription:
curl --location --request POST 'http://localhost1026/v2/subscriptions' \
--header 'Content-Type: application/json' \
--data-raw '{
"description": "Notify Cygnus Mongo-DB of all context changes",
"subject": {
"entities": [
]
},
"notification": {
"http":
},
"throttling": 5
}'
Batch Create a New Data Entity :
curl --location --request POST 'http://localhost:1026/v2/op/update/' \
--header 'Content-Type: application/json' \
--data-raw '{
"actionType":"append_strict",
"entities":[
{
"id":"urn:ngsi-ld:Product:100", "type":"Product",
"name":
,
"size":
,
"price":
},
{
"id":"urn:ngsi-ld:Product:101", "type":"Product",
"name":
,
"size":
,
"price":
}
]
}'
Result in Mongo:
Group updates also do not work.
Did I miss something in the configuration or there is no possibility for that in Cygnus?
Thank you in advance.
Activity
Field | Original Value | New Value |
---|---|---|
Component/s | FIWARE-TECH-HELP [ 10278 ] |
HD-Enabler | Unknown [ 10910 ] | |
HD-Chapter | Unknown [ 10845 ] | |
HD-Node | Unknown [ 10852 ] |
Status | Open [ 1 ] | In Progress [ 3 ] |
Assignee | Fermín Galán [ fermin ] |
Status | In Progress [ 3 ] | Answered [ 10104 ] |
Resolution | Done [ 10000 ] | |
Status | Answered [ 10104 ] | Closed [ 6 ] |
Summary | [fiware-stackoverflow] Multiple entities can't be saved at same time in Mongo historical database | FIWARE.Question.Tech.Multiple entities can't be saved at same time in Mongo historical database. |
HD-Enabler | Unknown [ 10910 ] | |
HD-Chapter | Unknown [ 10845 ] | |
HD-Node | Unknown [ 10852 ] |