IsDate
IsDate( value )
Description
The IsDate
function returns true
only if value
is a
Date, otherwise it returns false
.
Examples
The following query uses Map
to iterate over an array of all of
the types of values that can be tested by a type-check function, passing
each item into a Lambda
function that returns an object, which
contains the value and the result of calling IsDate
with that
value:
[
{ value: [ 'array' ], IsDate: false },
{ value: true, IsDate: false },
{ value: false, IsDate: false },
{ value: { '0': 1, '1': 2, '2': 3, '3': 4 }, IsDate: false },
{ value: [ 1, 2, 3, 4 ], IsDate: false },
{ value: Collection("Letters"), IsDate: false },
{ value: Ref(Credentials(), "302043979982045696"), IsDate: false },
{ value: Database("child_db"), IsDate: false },
{ value: Date("2019-11-12"), IsDate: true },
{ value: Ref(Collection("Letters"), "123"), IsDate: false },
{ value: 10.1, IsDate: false },
{ value: Function("double"), IsDate: false },
{ value: Index("letters"), IsDate: false },
{ value: 10, IsDate: false },
{ value: Ref(Keys(), "1"), IsDate: false },
{ value: Query(Lambda("x", Var("x"))), IsDate: false },
{ value: null, IsDate: false },
{ value: { x: 10 }, IsDate: false },
{ value: Role("employees"), IsDate: false },
{ value: Match(Index("letters")), IsDate: false },
{ value: 'ten', IsDate: false },
{ value: '10', IsDate: false },
{ value: Time("2020-07-06T12:34:56.789Z"), IsDate: false },
{ value: Ref(Tokens(), "1"), IsDate: false }
]
This query operates on a pre-existing schema, which is not provided here. Also, the query is executed via a client connection, that uses a secret
acquired by calling the |
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!