<![CDATA[ MIGX: finding multiple db field records - My Forums]]> https://forums.modx.com/thread/?thread=104371 <![CDATA[MIGX: finding multiple db field records]]> https://forums.modx.com/thread/104371/migx-finding-multiple-db-field-records#dis-post-561379
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:

[[!migxLoopCollection?
			&packageName=`gallery`
			&classname=`Gallery`
			&sortConfig=`[{"sortby":"title","sortdir":"ASC"}]`
			&where=`{"image_names:LIKE":"%John%","published":"1"}`
			&tpl=`mGalleryAlbum`
			]]


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.]]>
zinturis Sep 04, 2018, 09:43 PM https://forums.modx.com/thread/104371/migx-finding-multiple-db-field-records#dis-post-561379
<![CDATA[Re: MIGX: finding multiple db field records]]> https://forums.modx.com/thread/104371/migx-finding-multiple-db-field-records#dis-post-561579 thank you very much. This works exactly as I wanted.]]> zinturis Sep 17, 2018, 09:14 PM https://forums.modx.com/thread/104371/migx-finding-multiple-db-field-records#dis-post-561579 <![CDATA[Re: MIGX: finding multiple db field records (Best Answer)]]> https://forums.modx.com/thread/104371/migx-finding-multiple-db-field-records#dis-post-561551
&where=`[
      {"image_names:LIKE":"%John%"},
      {"OR:image_names:LIKE":"%Tom%"},
      {"published":"1"}
]`


See also https://docs.modx.com/xpdo/2.x/class-reference/xpdoquery]]>
just_nico Sep 15, 2018, 03:53 PM https://forums.modx.com/thread/104371/migx-finding-multiple-db-field-records#dis-post-561551