I have an array of objectIds = ["LlbAXkqOL4", "v7lSgUunbR"]
If I have only one object id, then I can use,
query.getObjectInBackgroundWithId("A2332xsdas2")
Since I have many objectIds, I am following this code:
let userQuery = PFUser.query()
userQuery?.whereKey("username", equalTo: self.user!.username!)
userQuery?.findObjectsInBackgroundWithBlock {
(object, error) -> Void in
if object != nil
{
for messageObject in object! {
self.importedArray = ((messageObject as! PFObject)["AllEventsId"] as? [String]!)!
println("importedArray = \(self.importedArray)")
}
}
}
var query:PFQuery = PFQuery(className: "Events")
query.whereKey("objectId", containedIn: self.importedArray)
query.whereKey("EventSTDTime", greaterThan: zDate)
query.findObjectsInBackgroundWithBlock {
(object, error) -> Void in
if object != nil
{
println(objects)
}
}
But this method is not working as it fetched all the id under the class Events

Eventsclass, if I have 10 rows, it is fetching all the 10 rows, I want only the rows that have theobjectIdam mentioning in the array:objectIdsimportedArrayin console and it is good.