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

FIWARE.Question.Tech.Data.OrionContextBroker.QueryByDates

    Details

      Description

      Created question in FIWARE Q/A platform on 17-09-2015 at 14:09
      Please, ANSWER this question AT http://stackoverflow.com/questions/32630801/query-orion-context-broker-by-dates

      Question:
      Query Orion Context Broker by Dates

      Description:
      I tried to query by dates interval in Orion 0.24 with no success.

      A call to:

      URL: http://<some-ip>:<some-port>/v2/entities?type=some-entity

      Gives:

      [
      {
      "id": "some-id",
      "type": "some-entity",
      "coordenadas":

      { "type": "geo:point", "value": "43.7723705, -7.6784461" }

      ,
      "fecha":

      { "type": "date", "value": "2015-08-21T22:00:00.000Z" }

      ,
      },
      {
      "id": "some-id",
      "type": "some-entity",
      "coordenadas":

      { "type": "geo:point", "value": "43.6850207, 7.5716216" }

      ,
      "fecha":

      { "type": "date", "value": "2015-09-09T22:00:00.000Z" }

      }
      ]

      Then I query by dates interval in the following ways:

      Call 1:

      http://<some-ip>:<some-port>/v2/entities?type=some-entity&q=fecha==2015-08-01T22:00:00.000Z..2015-08-30T22:00:00.000Z

      Call 2:

      http://<some-ip>:<some-port>/v2/entities?type=some-entity&q=fecha==1441065601..1443657601

      Both calls respond with a 200 code and payload []. I also tried other operators '>', '<' with the same result.

      EDIT

      I tried '==' over the property 'fecha' and works well:

      Call 3:

      http://&lt;some-ip&gt;:&lt;some-port&gt;/v2/entities?type=some-entity&amp;q=fecha==2015-08-21T22:00:00.000Z

      In the documentation says we can store dates, so I am doing so. Should I store them as numbers?

      thanks

        Activity

        fla Fernando Lopez made changes -
        Fix Version/s 2021 [ 12600 ]
        mev Manuel Escriche made changes -
        HD-Enabler Orion [ 10875 ]
        HD-Chapter Data [ 10838 ]
        oriondev TID Orion Developer made changes -
        Summary [fiware-stackoverflow] Query Orion Context Broker by Dates FIWARE.Question.Tech.Data.OrionContextBroker.QueryByDates
        mev Manuel Escriche made changes -
        Assignee Fermín Galán [ fermin ]
        backlogmanager Backlog Manager made changes -
        Resolution Done [ 10000 ]
        Status Answered [ 10104 ] Closed [ 6 ]
        backlogmanager Backlog Manager made changes -
        Status In Progress [ 3 ] Answered [ 10104 ]
        backlogmanager Backlog Manager made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        backlogmanager Backlog Manager made changes -
        Field Original Value New Value
        Component/s FIWARE-TECH-HELP [ 10278 ]
        backlogmanager Backlog Manager created issue -

          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: