---
title: "fetchCount(_:)"
framework: swiftdata
role: symbol
role_heading: Instance Method
path: "swiftdata/datastore/fetchcount(_:)"
---

# fetchCount(_:)

## Declaration

```swift
func fetchCount<T>(_ request: DataStoreFetchRequest<T>) throws -> Int where T : PersistentModel
```

## See Also

### Processing fetch requests

- [fetch(_:)](swiftdata/datastore/fetch(_:).md)
- [DataStoreFetchRequest](swiftdata/datastorefetchrequest.md)
- [DataStoreFetchResult](swiftdata/datastorefetchresult.md)
- [Snapshot](swiftdata/datastore/snapshot.md)
- [DataStoreSnapshot](swiftdata/datastoresnapshot.md)
- [DataStoreSnapshotValue](swiftdata/datastoresnapshotvalue.md)
- [fetchIdentifiers(_:)](swiftdata/datastore/fetchidentifiers(_:).md)
