Skip to content

new Date() in aggregation node.js #9116

@mbfakourii

Description

@mbfakourii

New Issue Checklist

Issue Description

Steps to reproduce

I have an Aggregation in mongo shell that works fine.

image
But it doesn't output anything in node.js !

var pipeline = [
    {
        $match: {
            _p_enx: "Entrix$" + req.params[KEY_ENTRIX_ID],
        },
    },
    {
        $lookup: {
            from: "KeyLink",
            let: {
                tempPointer: {
                    $substr: ["$_p_klk", 8, -1],
                },
            },
            pipeline: [
                {
                    $match: {
                        $expr: {
                            $and: [
                                {
                                    $eq: ["$$tempPointer", "$_id"],
                                },
                            ],
                        },
                    },
                },
            ],
            as: "klk",
        },
    },
    {
        $match: {
            $or: [
                {
                    "klk.exp": {
                        $gt: new Date(),
                    },
                },
            ],
        },
    },
];

var query = new Parse.Query(EntrixKeyLink);

let responseAggregation = await query.aggregate(pipeline, {useMasterKey: true});

I think there is a problem in new Date().

Actual Outcome

Nothing is output !

Expected Outcome

It should output like the image above

Environment

Server

  • Parse Server version: 6.3.1 and 7.0.0
  • Operating system: Windows

Database

  • System (MongoDB or Postgres): MongoDB
  • Database version: 7.0.8

Client

  • SDK (iOS, Android, JavaScript, PHP, Unity, etc): API
  • SDK version: n/a

Logs

n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    state:released-alphaReleased as alpha versiontype: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