Skip to content

Aggregation match doesn't seem to work with date value #4678

Description

@SebC99

Issue Description

When using the new aggregate options with a match pipeline on a Date value, it silently fails with empty result.
By the way, to match a createdAt or a updatedAt field, we have to use the db form _created_at / _updated_at, and I'm not sure it's on purpose. Either way, we can't query them with the standard $lt or $gt operator.

Steps to reproduce

query.aggregate([{match: {_created_at:{$lt:new Date()}}}]) always returns []
whereas
query.aggregate([{match: {_created_at:{$exists:true}}}]) works perfectly.

Expected Results

Both results should be the same

  • Server

    • parse-server version (Be specific! Don't say 'latest'.) : 2.7.4
    • Localhost or remote server? Localhost
  • Database

    • MongoDB version: 3.4
    • Storage engine: WiredTiger
    • Localhost or remote server? Mongo Atlas

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bugImpaired feature or lacking behavior that is likely assumed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions