Hi All,

DateTime index in not working properly  while writing json query. I have 
created element range index  for accessedTime.

Example: We have content like as.
{
"audit": {
"accessedTime": "2016-09-14T06:04:00",
"data": {
"entries": [
{
"name": "reportType",
"value": "Download"
}
]
},
"userName": "genuser",
"groups": {
"groupNames": [
"Test",
"Test2"
]
},
"identifier": "9695071722831412392"
}
}

When I am writing  a query like

  let $from-date := "2016-09-13T00:00:00"
  let $to-date := "2016-09-14T00:00:00"
  let $query := cts:and-query((
                           cts:json-property-range-query("accessedTime",">=", 
xs:dateTime($from-date)),
                           cts:json-property-range-query("accessedTime","<=", 
xs:dateTime($to-date))))
return cts:search(fn:doc(),$query)

Above query is not returning anything but when I am changing  to-date parameter 
to "2016-09-15T00:00:00",  I am getting result. It looks like comparison is not 
working for operator "<=" .

Regards,
Vikas Singh
This e-mail and any files transmitted with it are for the sole use of the 
intended recipient(s) and may contain confidential and privileged information. 
If you are not the intended recipient(s), please reply to the sender and 
destroy all copies of the original message. Any unauthorized review, use, 
disclosure, dissemination, forwarding, printing or copying of this email, 
and/or any action taken in reliance on the contents of this e-mail is strictly 
prohibited and may be unlawful. Where permitted by applicable law, this e-mail 
and other e-mail communications sent to and from Cognizant e-mail addresses may 
be monitored.
_______________________________________________
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to