delete method
Deletes a document from the collection by its ID.
The id
should be a valid MongoDB ObjectId string.
Returns true
if the deletion was successful, otherwise false
.
Implementation
Future<bool> delete(String id) async {
var oid = ObjectId.tryParse(id);
if (oid != null) {
return deleteOid(oid);
}
return false;
}