Search code examples
parse-platformparse-server

Parse: Retrive all Objects where user is in a relation


I have a Parse Object Event it contain a key attendees, a Parse Relation object. My question is how to retrieve all event where current user is in the attendees relation ? my current code is :

var query = new Parse.Query(Event).equalTo('attendees',currentUser)
query.find({
   success:function(list){
   }
})

Solution

  • Your query seems Ok, try to verify your data in DB.

    cmd from mongo shell

    db.getCollection('_Join:attendees:Event').find({'relatedId':currentuserId})