javascript - associating an array of photos with a user on parse.com -
i'm trying upload several user photos parse.com , associate them user object. i'm using javascript sdk https://www.parse.com/docs/js_guide#objects-types i'm able save photo file object. when try build array column in user object/table sdk errors out.
i error json.stringify cannot serialize cyclic structures.
upon saving user object.
profilecontroller.js
// uploads photo rest api given local file_uri $scope.addphoto = function() { var file = new parse.file("profile-image.jpeg", { base64: $scope.imagedata }); file.save().then(function(res) { console.log('success', res); var array = ['foo', file]; $scope.user.set('photos', array); $scope.user.save(); }, function(error) { console.log('error', error); }); };
this error arises when object being serialized holds references itself. question - there way associate user image files user object on parse.com? ideally array column because know there never more 5 profile images per user.
pictureholder.class
{"photos":["url": $parsefile1, "url":$parsefile2, "url":$parsefile3...]}
_user contains following pointer column.
{"linkphotos":{"__type":"pointer","classname":"pictureholder","objectid":$id_pointed_to}}
flat query on _user table add following query.parms...
include=linkphotos
that inline json response, full, linked row 2nd table.
Comments
Post a Comment