Thursday, April 30, 2026
HomeiOS Developmentios - Back4app, filter question primarily based on null worth or undefined...

ios – Back4app, filter question primarily based on null worth or undefined worth

[ad_1]

In database appears we now have two kinds of non present values:

(undefined) and (null)

If I do question

if paidDateDoesNotExist == true {
 question.whereKeyDoesNotExist("paidDate")
}

appears to be like prefer it returns solely undefined however no null data which is appears appropriate.

If I do question

if paidDateDoesNotExist == true {
 question.whereKey("paidDate", equalTo: NSNull())
}

it returns the all undefined and null data.

So for some circumstances I must clear worth from consumer code. For instance I’ve paidDate column and I wish to clear paidDate which was set to some Date already.

in my consumer code I simply easy assign NSNull() to PFObject

like pfObject["paidDate"] = NSNull()

on this circumstances question question.whereKeyDoesNotExist("paidDate") is not going to work.

So the factor I wish to perceive – do I must assign pfObject["paidDate"] = (undefined) worth one way or the other or I simply want to make use of one other question which is makes use of NSNull() as filter.

Which is extra enjoyable after I use related question kind the admin panel, admin panel returns data that are equal to null solely ignoring undefined data. However for consumer code question:

if paidDateDoesNotExist == true {
 question.whereKey("paidDate", equalTo: NSNull())
}

returns undefined data in addition to null data.

enter image description here

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments