0

REST wont return no results when comparing date:

/groups@org?_queryFilter=(validFrom+ge+"201508280000")&_prettyPrint=true or

/groups@org?_queryFilter=(validFrom+le+"201508280000")&_prettyPrint=true

result:

{
  "result" : [ ],
  "resultCount" : 0,
  "pagedResultsCookie" : null,
  "remainingPagedResults" : -1
}

the date is in the result when filter is not used:

..,{

    "validTo" : "201506120000+0100",
    "_rev" : "0000000000a3ab4a",
    "schemas" : [ "urn:scim:schemas:core:1.0" ],
    "_id" : "9b682c25-359d-4cf3-b0a6-49401d0f9386",
    "validFrom" : "201506080000+0100"
},..
Matej
  • 11
  • 4

2 Answers2

0

Can you check OpenDJ access logs and whether the filter translated to LDAP makes sense ? I've just tried on my local server and it seems that the date is actually treated as seconds and not UTC.

Ludovic Poitou
  • 4,788
  • 2
  • 21
  • 30
  • Actually, after a quick discussion with the OpenDJ architect, he pointed out to me that the JSON format for dates was defined by ISO 8601. So the date you're passing in is invalid and result in Undefined. You may want to try to following query : `/groups@org?_queryFilter=(validFrom+ge+"2015-08-28")&_prettyPrint=true or /groups@org?_queryFilter=(validFrom+ge+"2015-08-28T00:00:00Z")&_prettyPrint=true ` – Ludovic Poitou Jun 25 '15 at 15:57
  • I made my own research and figured out that only date in format like this "20150128000000Z" works. /groups@org?_queryFilter=(validFrom+ge+"20150128000000Z")&_prettyPrint=true. I tried even your query. – Matej Jun 26 '15 at 07:54
  • Where can I find the described OpenDJ access log where the filter should be translated to LDAP? I chcecked all files in opendj/logs and found no evidence about the translation – Matej Jun 26 '15 at 08:05
  • In order to view the OpenDJ access logs and filter translated to LDAP, you need to enable logging internal operations. (ds-cfg-suppress-internal-operations: false in the entry File-Based Access Logger). Also the result may depend on the syntax of the attribute that is mapped with "validFrom". I tested with "meta/lastModified" successfully. – Ludovic Poitou Jun 26 '15 at 15:54
0

I don't know if I figured it out, but the date in the filter must be in format YYYYMMDDhhmmssZ like this 20150101000000Z

Matej
  • 11
  • 4