Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I would like to know if exist any way to check in a Parse.com database a repeat object, for example, I have this function:

             $scope.addRecoDeseo = function(){

                        var DeseoObjeto = new DeseoModel();

                        DeseoObjeto.set("User",Parse.User.current());
                        DeseoObjeto.set("Deseo",$scope.recomendado);

                        DeseoObjeto.save(null, {
                                  success: function(obj) {
                                        alert('ok')
                                  },
                                  error: function(obj,error) {
                                    alert("error")

                                  }
                                });

            }

are there any way to have a error if exist a object with the same User and Deseo?

share|improve this question

1 Answer 1

You could use CloudCode to implement a unique field, check the answer here: Parse.com post

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.