1

I have an article object which include an array field tags. I want to find all articles contains certain tags. Here is my code:

  var Article = Parse.Object.extend('Article');
  var query = new Parse.Query(Article);
  query.containsAll('tags',tags);
  query.find({
    success : function(results) {
      console.log(results);

The tags in my code is an array like, ["tag1","tag2"]. My code always return empty. Anything wrong? Thanks.

1 Answer 1

2

Have you tried using containedIn function? If you pass an array to it, it searches for the requested value.

query.containedIn("tags", tags);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.