getByIndex method
Get a single object by the unique index indexName
and key
.
Returns null
if the object does not exist.
If possible, you should use the generated type-safe methods instead.
Implementation
@experimental
Future<OBJ?> getByIndex(String indexName, IndexKey key) {
return getAllByIndex(indexName, [key])
.then((List<OBJ?> objects) => objects[0]);
}