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

        Hide
        backlogmanager Backlog Manager added a comment -

        2015-10-18 06:05|CREATED monitor | # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2015-10-18 06:05|CREATED monitor | # answers= 1, accepted answer= True
        Hide
        backlogmanager Backlog Manager added a comment -

        2015-10-18 09:05|UPDATED status: transition Answer| # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2015-10-18 09:05|UPDATED status: transition Answer| # answers= 1, accepted answer= True
        Hide
        backlogmanager Backlog Manager added a comment -

        2015-10-18 12:05|UPDATED status: transition Answered| # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2015-10-18 12:05|UPDATED status: transition Answered| # answers= 1, accepted answer= True
        Hide
        backlogmanager Backlog Manager added a comment -

        2015-10-19 09:05|UPDATED status: transition Finish| # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2015-10-19 09:05|UPDATED status: transition Finish| # answers= 1, accepted answer= True

          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: