I have a collection that includes a field of type Time. I need to be able to query this collection by year, or month-year combination.
I have tried using the index creation tool on the web site itself, using things like Year(data.expDate)
and Month(data.expDate)
in the Terms, but this did not work.
Here is the schema for my collection:
type Expense {
_id: ID!
expAmount: Float!
expDate: Time!
expCategory: Category!
_ts: Long!
}
I need to be able to list the expenses for a particular year, or a particular month-year, without having to create separate month and year fields in my collection.