Skip to content

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

Closed
@meilers

Description

@meilers

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!

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