getDocument method

Future<Response> getDocument({
  1. required String collectionId,
  2. required String documentId,
})

Get Document

Get a document by its unique ID. This endpoint response returns a JSON object with the document data.

Implementation

Future<req.Response> getDocument(
    {required String collectionId, required String documentId}) {
  final String path =
      '/database/collections/{collectionId}/documents/{documentId}'
          .replaceAll(RegExp('{collectionId}'), collectionId)
          .replaceAll(RegExp('{documentId}'), documentId);

  final Map<String, dynamic> params = {};

  final Map<String, String> headers = {
    'content-type': 'application/json',
  };

  return client.call(HttpMethod.get,
      path: path, params: params, headers: headers);
}