Skip to content

Parse.Query.toJSON() not working for aggregate query #918

Open
@mtrezza

Description

@mtrezza

Issue Description

Parse.Query.toJSON() returns an empty query when the query is an aggregate query.

Steps to reproduce

const query = new Parse.Query("MyCollection");
const pipeline = {
    "match":{"language":{"$in":[null,"en"]}},
};
const results = await query.aggregate(pipeline);
const queryJson = query.toJSON(); // returns `{where: {}}`

Expected Results

query.toJSON() should return the aggregate query.

Actual Outcome

query.toJSON() returns {where: {}}.

Environment Setup

  • Server

    • parse-server version (Be specific! Don't say 'latest'.) : 3.8.0
    • Operating System: -
    • Hardware: -
    • Localhost or remote server? (AWS, Heroku, Azure, Digital Ocean, etc): -
  • JS SDK

    • JS SDK version: 2.7.0
    • Application? (Browser, Node, React-Native, etc): -

Logs/Trace

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