ContainsField
ContainsField( field, in )
ContainsField( field, in )
ContainsField( field, in )
ContainsField( field, in )
contains_field( field, in )
ContainsField( field, in )
Description
The ContainsField
function returns true
if the specified field
exists
within the result of the in
expression, or false
otherwise.
ContainsField
is useful when you need to distinguish between objects,
arrays, or documents that contain a field and those that do not.
Parameters
Argument | Type | Definition and Requirements |
---|---|---|
|
types:string[] |
The name of a field. |
|
A value of any type. |
Examples
The following query returns true
because the field a
exists
in the provided object:
BooleanV(True)
true
true
true
True
true
The following query returns false
because the field f
does not exist
in the provided object:
BooleanV(False)
false
false
false
False
false
Was this article helpful?
We're sorry to hear that.
Tell us how we can improve!
Visit Fauna's Discourse forums
or email docs@fauna.com
Thank you for your feedback!