MongoDB datastore fails to handle date filters

Description

A WMS request is built with the following filter on a date attribute:

1 2 3 4 5 6 7 8 9 <PropertyIsGreaterThan> <PropertyName> date </PropertyName> <Function name="parseDate"> <Literal>yyyy-MM-dd</Literal> <Literal>2015-07-01</Literal> </Function> </PropertyIsGreaterThan>

The query string getting sent to MongoDB from geoserver looks like

1 2 3 4 5 { "date" : { "$gt" : "Wed Jul 01 00:00:00 UTC 2015" } }

The query returns nothing because the result of Date.toString() is being passed to MongoDB; instead, the generated query should look like this:

1 2 3 4 5 { "date" : { "$gt" : ISODate("2015-07-01T00:00:00Z") } }

Environment

None

Status

Assignee

Stefano Costa

Reporter

Stefano Costa

Triage

None

Components

Fix versions

Priority

Medium