Skip to content

include() in aggregate queries #4728

Closed
Closed

Description

@fmendoza

I'm trying to show the pointer data but it seems is not supported?

let query = new Parse.Query('MyObject')
query.include(['myPointer'])

let pipeline = {
    match: { sectionType: 'Used', status: 'Active', deletedAt: { '$exists': false } },
    sample: { size: 10 }
}

let result = await query.aggregate(pipeline)

Expected Results

myPointer field should return all database fields

Actual Outcome

myPointer only return className, objectId and __type fields.

Environment Setup

  • Server

    • parse-server version: 2.7.4
    • Operating System: Mac
    • Hardware: Macbook Pro
    • Localhost or remote server?: Localhost
  • Database

    • MongoDB version: 3
    • Storage engine: n/a
    • Hardware: Macbook
    • Localhost or remote server? : Localhost

Logs/Trace

n/a

Activity

  1. dplewis commented on May 2, 2018

    @dplewis
    Member

    Its currently not supported. Since you are using aggregate you can use $lookup (left join) #1908 (comment)

    Feel free to open a PR. I'm a bit surprised that mypointer returned data without using project stage.

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