solved Search for no price

nate
@nate
10 years ago
917 posts
Here's my situation. I have a radio button that says "include item in mobile mudic store?" If this is set to yes it will be listed. If there is no price it will listed separately in the free downloads.

How do I query a missing key?

Or should I require an entry in the audio_file_item_price field? In other words, forces them to enter 0.00. BUT if the user doesn't want them item listed I want the requirement off.

Keep in mind the user is using jrAudio to create the song.
updated by @nate: 01/18/15 08:29:33PM
brian
@brian
10 years ago
10,149 posts
the core DataStore functions will include items missing a key if you use a "not" operator - i.e.

audio_file_item_price not_like %.%

Is saying "get all entries that either do NOT have a audio_file_item_price field OR the audio_file_item_price field is not anything then period then anything"

So you can probably play around with that and get what you're looking for.

Hope this helps!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
nate
@nate
10 years ago
917 posts
That makes sense. If the "." is not there then it's likely blank. I should have been able to think of that.
brian
@brian
10 years ago
10,149 posts
Natedogg265:
That makes sense. If the "." is not there then it's likely blank. I should have been able to think of that.

No worries - you may not have know it would also include items that don't have the key :)


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
nate
@nate
10 years ago
917 posts
That's the part that I couldn't figure out. Datastore objects make life easier over all. But sometimes...
paul
@paul
10 years ago
4,335 posts
I'm going to writer this one down. I can never remember how its done either ;-)


--
Paul Asher - JR Developer and System Import Specialist

Tags