Session: How to Check if a Document Exists
Syntax
boolean exists(String id);
Parameter | Type | Description |
---|---|---|
id | String |
The ID of the document you want to check the database for |
Return Value | Description |
---|---|
boolean |
Indicates whether a document with the specified ID exists in the database |
Example
boolean exists = session.advanced().exists("employees/1-A");
if (exists) {
// do something
}