On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • Hi,

    say I have a custom db fields with multiple names in a single field like: "John,Alex,Tom". I want to find or get all fields that have any of names passed to the db with migx special tag. Something like search DB for given names to match.
    For instance this works fine when I pass only one name:


    But how to pass multiple names in one call? I tried different ways: with commas, spaces, etc. nothing seems to be working. Something like this (also need non case-sensitive as well?):

    &where=`{"image_names:LIKE":"%John% or %Tom%","published":"1"}`

    Thank you.

    This question has been answered by just_nico. See the first response.

    • discuss.answer
      Untested, but it should work when you use separate array objects .

      See also https://docs.modx.com/xpdo/2.x/class-reference/xpdoquery
      • Nico,
        thank you very much. This works exactly as I wanted.