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

FIWARE.Question.Tech.Multiple entities can't be saved at same time in Mongo historical database.

    Details

      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": [

      { "idPattern": ".*" }

      ]
      },
      "notification": {
      "http":

      { "url": "http://10.0.0.5:5051/notify" }

      },
      "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":

      {"type":"Text", "value":"Brandy"}

      ,
      "size":

      {"type":"Text", "value": "M"}

      ,
      "price":

      {"type":"Integer", "value": 1199}

      },
      {
      "id":"urn:ngsi-ld:Product:101", "type":"Product",
      "name":

      {"type":"Text", "value":"Port"}

      ,
      "size":

      {"type":"Text", "value": "M"}

      ,
      "price":

      {"type":"Integer", "value": 1099}

      }
      ]
      }'

      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

          People

          • Assignee:
            fermin Fermín Galán
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: