exists()

Test if a document exists.

Signature

exists(): Boolean

Description

The exists() method tests if a document instance exists.

Use exists() to find if the document can be read. If exists() returns false, there is a corresponding cause field that indicates the reason that the document can’t be read. Possible reasons are:

  • Not found.

  • Permission denied.

If the exists field isn’t present, the document may or may not exist.

Parameters

None

Return value

Type Description

Boolean

true = The document exists.
false = The document doesn’t exist.

Examples

Library.byId("338559528754741281").exists()
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!