Skip to content

aggregate query with 2 lookups not working #5201

Description

@ranhsd

Hi,
The following aggregation is not working:

        let aggregation = [
            {
                match: {
                    lastSeenDate: { $lte: date }
                }
            },
            {
                lookup:{
                    from: "_User",
                    localField: "userId",
                    foreignField: "_id",
                    as: "user"
                }
            },
            {
                unwind: {
                    path: "$user"
                }
            },
            {
                lookup: {
                    from: "Closet",
                    localField: "ownerId",
                    foreignField: "user._id",
                    as: "closet"                    
                }
            },
            {
                unwind: {
                    path: "$closet"
                }
            },            
            {
                limit: 10
            }
        ];

If I remove one of the lookups from the aggregation it works as expected but it doesn't work if I add another lookup to the query.

I tried to use the same aggregation in a MongoDB GUI client (3T Studio) and there it works well.

I wanted to know if there is a limitation to one lookup only?

Thanks!

Activity

  1. dplewis commented on Nov 28, 2018

    @dplewis
    Member

    What version of parse server and JS SDK are you running?

  2. ranhsd commented on Nov 29, 2018

    @ranhsd
    ContributorAuthor

    Hi @dplewis I'm still on parse-server 2.8.4 which use JS SDK 1.11.1

    I cannot upgrade now to Parse 3 because I have a lot of cloud code functions which needs to migrated.

  3. dplewis commented on Nov 29, 2018

    @dplewis
    Member

    This has already been addressed #4835

    Released on Parse 3

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions