Skip to content

Internal error when querying custom object through custom mongoURI from parse.com #292

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

Closed
meilers opened this issue Feb 8, 2016 · 1 comment

Comments

@meilers
Copy link

meilers commented Feb 8, 2016

I'm still hosting Parse on parse.com, but I'm pointing to a mongo DB on mongoLab. I created a new Parse app and added a custom mongo URI so I can deal with the parse-server migration later but still have my database somewhere else.

I have a custom object called "Observation" that I'm querying with the iOS sdk. Here's the code:

let calendar = NSCalendar.currentCalendar()
let daysAgo = calendar.dateByAddingUnit(.Day, value: -date, toDate: NSDate(), options: [])
let query = PFQuery(className:"Observation")
            .whereKey("location", nearGeoPoint: PFGeoPoint(latitude:location.latitude, longitude:location.longitude), withinKilometers: radius)
            .whereKey("obsDate", greaterThan:daysAgo!)
            .includeKey("birder")

Here's the error I get:

[Error]: internal error (Code: 1, Version: 1.12.0)
[Error]: Network connection failed. Making attempt 4 after sleeping for 9.990997 seconds.
...
Error Domain=Parse Code=1 "internal error" UserInfo={code=1, temporary=1, error=internal error, NSLocalizedDescription=internal error}

When I remove the ".includeKey("birder")", the error goes away. So it seems to be a pointer problem. Yet when I look in the mongo DB, the pointer is set correctly in Observation:

{
    "_id": "Ue7MQvZSsT",
    "_p_birder": "_User$8I2j7W4P7Z",
}

And the referenced User exits (in _User collection):

{
    "_id": "8I2j7W4P7Z",
    ...
}

Once again, I'm still using parse.com's server. The only difference is that I'm pointing to a custom mongoURI provided by mongoLab.

Any ideas? Thanks!

@drew-gross
Copy link
Contributor

If you have issues with apps on parse.com, please contact support through the "contact us" link at parse.com/help

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

2 participants