Objective-C PFQuery for string contained in an array?

ChrisC

I have a Parse table that contains a "UserIDs" column, which is an array of Strings.

I want to query this table for any Row which contains a certain specified UserID in the userIDs column.

For example, let there be a row that contains "0zll0s7Faz", "x62ks620", ..., "x2jdo322" in this column, how can I get this row with a PFQuery.

So far, I have a PFQuery as follows:

PFQuery *query=[PFQuery queryWithClassName:@"Albums"];
NSString *ide = [PFUser currentUser].objectId;

[query whereKey:@"UserIDs" containsString:ide];

Alternatively, I have used

[query whereKey:@"UserIDs" equalTo:ide];

Is it possible to do this as simply as I want it, or what can you suggest?

danh

whereKey:equalTo: tests equality on a singular column, but it also tests membership on an array column, so...

PFQuery *query=[PFQuery queryWithClassName:@"Albums"];
NSString *ide = [PFUser currentUser].objectId;
[query whereKey:@"UserIDs" equalTo:ide];

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Objective-C PFQuery for string contained in an array?

From Dev

Parse PFQuery to array objective-c

From Dev

objective c regex how to find string and returning contained line?

From Dev

Swift Converting PFQuery to String Array for TableView

From Dev

parse JSON string into array of objects Objective C

From Dev

Concatenate String in Array of Integers in Objective C

From Dev

Perl searching for string contained in array

From Dev

PFQuery returns Empty Array

From Dev

How to check if string is contained in an array in AutoHotKey

From Dev

Remove words from string contained in array

From Dev

Objective-C: How to find the most common string in an array?

From Dev

Trouble using strcpy with character array and string values in Objective-C

From Dev

Objective-C: How to find the most common string in an array?

From Dev

specifying an array by name, using a string. Objective C

From Dev

parse JSON string to NSDictionary into array of objects Objective C

From Dev

How to find greatest numeric value in Array of string in objective-c?

From Dev

How to add Array as string in Core Data in Objective c

From Dev

Objective c- get sub json string in json array

From Dev

Clean a string in objective c

From Dev

Objective C String Manipulation

From Dev

Objective C : Array

From Dev

array of UIImageView in objective c

From Dev

How to remove parentheses from string got from array of array in objective c?

From Dev

mongodb C# drive query with string field be contained for string arg

From Dev

How to efficiently check if any substring in an array is contained in another string

From Dev

How to efficiently check if any substring in an array is contained in another string

From Dev

How do I return a specific value if a string is not contained in an array

From Dev

Objective C Macro append to string

From Dev

Objective c Split String Issue

Related Related

  1. 1

    Objective-C PFQuery for string contained in an array?

  2. 2

    Parse PFQuery to array objective-c

  3. 3

    objective c regex how to find string and returning contained line?

  4. 4

    Swift Converting PFQuery to String Array for TableView

  5. 5

    parse JSON string into array of objects Objective C

  6. 6

    Concatenate String in Array of Integers in Objective C

  7. 7

    Perl searching for string contained in array

  8. 8

    PFQuery returns Empty Array

  9. 9

    How to check if string is contained in an array in AutoHotKey

  10. 10

    Remove words from string contained in array

  11. 11

    Objective-C: How to find the most common string in an array?

  12. 12

    Trouble using strcpy with character array and string values in Objective-C

  13. 13

    Objective-C: How to find the most common string in an array?

  14. 14

    specifying an array by name, using a string. Objective C

  15. 15

    parse JSON string to NSDictionary into array of objects Objective C

  16. 16

    How to find greatest numeric value in Array of string in objective-c?

  17. 17

    How to add Array as string in Core Data in Objective c

  18. 18

    Objective c- get sub json string in json array

  19. 19

    Clean a string in objective c

  20. 20

    Objective C String Manipulation

  21. 21

    Objective C : Array

  22. 22

    array of UIImageView in objective c

  23. 23

    How to remove parentheses from string got from array of array in objective c?

  24. 24

    mongodb C# drive query with string field be contained for string arg

  25. 25

    How to efficiently check if any substring in an array is contained in another string

  26. 26

    How to efficiently check if any substring in an array is contained in another string

  27. 27

    How do I return a specific value if a string is not contained in an array

  28. 28

    Objective C Macro append to string

  29. 29

    Objective c Split String Issue

HotTag

Archive