one<T> method
- dynamic object, {
- String? subcollection,
Checks if a document exists in the RDB.
Implementation
Future<bool> one<T>(dynamic object, { String? subcollection }) async {
if (object.id == null) {
return false;
}
String path = RDB.constructPathForClassAndID(object.runtimeType, object.id, subcollection: subcollection);
final snapshot = await RDB.instance.ref(path).get();
return snapshot.exists;
}