1

I need to get data where property "type1", "type2", etc., etc., is "not equal to 'null'" AND "not equal to the string 'no_issue'". I've tried a few different ways with no luck and this is what I currently have that is not working:

  [Op.and]: [
        { type1: { [Op.not]: null }},
        { type1: { [Op.ne]: 'no_issue' }},
        { next_item: 'next' }
     ],
     [Op.and]: [
      { type2: { [Op.not]: null }},
      { type2: { [Op.ne]: 'no_issue' }},
      { next_item: 'next' }
   ],
      [Op.and]: [
        { type3: { [Op.not]: null }},
        { type3: { [Op.ne]: 'no_issue' }},
        { next_item: 'next' }
    ],
    [Op.and]: [
      { type4: { [Op.not]: null }},
      { type4: { [Op.ne]: 'no_issue' }},
      { next_item: 'next' }
    ],
    [Op.and]: [
      { type5: { [Op.not]: null }},
      { type5: { [Op.ne]: 'no_issue' }},
      { next_item: 'next' }
    ]
    }

This looks to be correct but I'm obviously missing something. Thanks in advance!

1 Answer 1

4

Op.and should be an array of objects

      [Op.and]: [
         { type1: { [Op.not]: null }},
         { type1: { [Op.ne]: 'no_issue' }}
      ],...
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks! I tried this but it didn't work. I've updated the code above so you can see the full block I'm trying to implement.
It works (as it did before) if the items are not null so I was wondering if I need to do something like a "if not null, then check if type1 is not equal to 'no_issue'

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.