Skip to content

Cannot Store Array's in Parse Server "_User" #1508

Closed
@Jerland2

Description

@Jerland2

Platform

I am using Parse Server with Heroku and mLabs

Problem

I am able to upload an array to mLabs and store it in the "_User" class, however I am not able to retrieve the users when this is happening. i.e. I am not able to log in as that user. Similarly The parse Dashboard also does not populate the "_User" class if there are arrays being stored. I have not tried to store and retrieve arrays in any other custom class. Is it possible to allow arrays to be stored in parse server "_User" class or in any custom class?

Edit: The problem is even more confusing than i thought. Using Parse Dashboard manually adding things to an array stored in "_User" works fine. However using my ios app to upload the arrays does not.... I have double checked the visuals of the structure of Arrays in mLabs looks identical.

Code Used for Uploading Arrays to "_User"

` let user = PFUser.currentUser()!
user["Array1"] = Array1
user["Array2"] = Array2
user["Array3"] = Array3

    user.saveInBackgroundWithBlock {
        (succeeded: Bool, error: NSError?) -> Void in
        if let error = error {
            _ = error.userInfo["error"] as? NSString
            print("failed")

        } else {
           //Successful Upload

        }


    }`

Edit: After further testing, i have found what I believe to be the root of the problem. One of my arrays is not being uploaded to Parse when I create a new user. I am uploading empty arrays now, however after 2 successful arrays being created the third is "Undefined" and that is where the error is occurring I believe. Im not sure why it is undefined as I am using the same syntax for each one and the other two are working just fine.
Edit2: Using Parse Dashboard I am not able to manually enter an array into the one that is "Undefined" After entering it and pressing enter the field goes back to saying "undefined"

SOLUTION

I had a corrupted column in my database or something, after renaming and deleting the data point it now works as intended. (ITs weird though because now I cant name the column what it was before or it stays corrupted..... Interesting bug)

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