document method

Future<Map<String, dynamic>> document(
  1. String documentHandle,
  2. {bool graceful = false,
  3. bool allowDirtyRead = false}
)

Implementation

Future<Map<String, dynamic>> document(
  String documentHandle, {
  bool graceful = false,
  bool allowDirtyRead = false,
}) async {
  try {
    final resp = await _connection.request(
      path: '/_api/${_documentPath(documentHandle)}',
      allowDirtyRead: allowDirtyRead,
    );
    return resp.body;
  } on ArangoError catch (e) {
    const DOCUMENT_NOT_FOUND = 1202;
    if (graceful || e.errorNum == DOCUMENT_NOT_FOUND) {
      return null;
    } else {
      rethrow;
    }
  }
}