Contains
Copied!
Contains( path, in )
Description
The Contains
function returns true
if the argument passed as in
contains a value at the specified path, and false
otherwise.
This function is deprecated. You should use its alias
ContainsPath instead,
or the related
ContainsField and
ContainsValue
functions.
|
Examples
The following query returns true
because the path favorites.foods
exists in the provided object:
Copied!
client.query(
q.Contains(
['favorites', 'foods'],
{
favorites: {
foods: ['crunchings', 'munchings', 'lunchings'],
},
},
)
)
.then((ret) => console.log(ret))
true
Is this article helpful?
Tell Fauna how the article can be improved:
Visit Fauna's forums
or email docs@fauna.com
Thank you for your feedback!