existId method

Future<bool> existId(
  1. String idField
)

Checks if a document with the given ID exists in the collection.

The idField should be a valid MongoDB ObjectId string.

Returns true if the document exists, otherwise false.

Implementation

Future<bool> existId(String idField) async {
  var id = ObjectId.tryParse(idField);
  return existOid(id);
}