hasOne method
Implementation
Future<B?> hasOne(A model) async {
List<dynamic> models = await Collection.get(modelType: B)
.where('${Model.typeToId(A)}_id', model.getId());
if (models.isEmpty) {
return null;
}
return models.first;
}