Skip to content

Cast to date failed error when using date value inside filter with _operators #184

@corydeppen

Description

@corydeppen

I'm using a filter similar to the following and running into an error "Cast to date failed for value \"{ '': 2019-01-01T00:00:00.000Z }\" at path \"beginsAt\" for model \"Event\"".

filter: {
  _operators: { beginsAt: { gte: "2019-01-01T00:00:00.000Z" } }
}

It seems related to how the _toMongoDottedObject function builds up the query conditions.

I have a failing test that I'll submit as a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions