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

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

Closed
Jerland2 opened this issue Apr 15, 2016 · 4 comments
Closed

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

Jerland2 opened this issue Apr 15, 2016 · 4 comments

Comments

@Jerland2
Copy link

Jerland2 commented Apr 15, 2016

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)

@drew-gross
Copy link
Contributor

There is a lot going on in this bug report... could you try to simplify and clarify whats going on here? The ideal bug report would be a snippet of code that reliably reproduces the problem.

@Jerland2
Copy link
Author

I agree, under the solution heading, it seems to be a corrupt mLabs data type. Everything is working as intended, except i cannot use the name "className" I never found the solution as to why, my solution was to choose a different name for the array being stored. Perhaps it conflicted with code due to being similar to consisting of class and name.
TLDR; Never found solution, changing the name of data store object fixed issue

@drew-gross
Copy link
Contributor

Checking the contents of your _SCHEMA collection for _User on mLabs might also help us find this issue.

@flovilmart
Copy link
Contributor

Closing due to lack of activity, please reopen if the issue persist.

Don't forget to include your current:

  • node version
  • npm version
  • parse-server version
  • any relevant logs (VERBOSE=1 will enable verbose logging)

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