How can I make Parse.Query.AND?

后端 未结 1 796
遥遥无期
遥遥无期 2021-01-21 03:47

I need to connect 2 queries in Parse.com with an and, my code is:

    var queryDeseo1 = new Parse.Query(DeseosModel);
    queryDeseo1.equalTo(\"User\", Parse.Use         


        
相关标签:
1条回答
  • 2021-01-21 04:19

    You've actually got it setup correctly to do an AND query. The problem (assuming that your data structure is setup properly) is that your User field is a Pointer to the User table. Therefore, you need to query for a User equal to the pointer, as opposed to a User equal to Parse.User.current() which will return a string. Something like the following:

    var userPointer = {
      __type:    'Pointer',
      className: 'User',
      objectId:  Parse.User.current().id
    }
    
    queryDeseo1.equalTo('User', userPointer);
    
    0 讨论(0)
提交回复
热议问题