Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit on number of 'include' statements ? #195

Closed
danielb93 opened this issue Feb 3, 2016 · 2 comments
Closed

Limit on number of 'include' statements ? #195

danielb93 opened this issue Feb 3, 2016 · 2 comments

Comments

@danielb93
Copy link

I've began the tedious process of migrating over to a self-hosted Parse 'stack' and have ran into an issue where 'include' statements are ignored if more than 10 are included.

I'm using a locally hosted MongoDB and a local v2.0.5 instance of 'parse-server' and interacting with it via the v1.1.10 PHP SDK. Example code below:

public function allTheIncludes() {

        $query = new ParseQuery('GameScore');
        $query->includeKey('field1');
        $query->includeKey('field2');
        $query->includeKey('field3');
        $query->includeKey('field4');
        $query->includeKey('field5');
        $query->includeKey('field6');
        $query->includeKey('field7');
        $query->includeKey('field8');
        $query->includeKey('field9');
        $query->includeKey('field10');

        try {

            $result = $query->first();
        } catch(ParseException $e) {

            die("{$e->getMessage()} \n\n" . $e->getTraceAsString());
        }

        //Assign pointer to variable
        $pointer    = $result->get('field6');

        // Ensure pointer value is set and grab name
        if(!empty($pointer)) {

            $name = $pointer->get('name');
            die("Name from pointer is: {$name}");
        }

        die("Pointer value is empty :(");
    }

The above works fine, outputting Name from pointer is: Jeff

However adding an additional include causes the above code to throw an exception:

ParseObject has no data for this key. Call fetch() to get the data.

Is there a hard limit imposed for the number of includes allowed or is this unintentional (this code executes successfully on a Parse hosted instance)?

EDIT: It also seems that if you try to include a field that has already been included that points to the same record it causes that record to not be included at all.

Example:

If field1 and field7 point to a record in the _User class with an objectId of fuvNKdxHKo and you include both fields, that object will not be included. Accessing a field within that pointer will throw an exception.

@gfosco
Copy link
Contributor

gfosco commented Feb 3, 2016

I don't see any limits being imposed on this, in RestQuery.js... Try creating a failing test in ParseQuery.spec.js

montymxb pushed a commit to montymxb/parse-server that referenced this issue Feb 14, 2016
Adding the types of parameters in PaseHooks class
@mchun
Copy link

mchun commented Feb 16, 2016

#426 see if this is your case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants