Reputation: 13843
I have rules like this
(user.lastEventApproval is timestamp || user.lastEventApproval is null)
I want to make lastEventApproval
field in my user document to be timestamp or it can be null
but I have error like this
mismatched input 'null' expecting IDENTIFIER
An unsupported type identifier was used with the 'is' operator. Received null). Expected one of bool,bytes,constraint,duration,float,int,latlng,list,set,number,map,string,timestamp,path,map_diff
so can I set my field to be timestamp or null in security rules ? maybe there is a way to do this
Upvotes: 0
Views: 134
Reputation: 317692
The error message is telling you that null
is not a valid comparison target for the is
keyword. You should use user.lastEventApproval == null
instead, if you want to know if that field contains a null value.
Upvotes: 2