---
title: NSFetchRequestExpression
framework: coredata
role: symbol
role_heading: Class
path: coredata/nsfetchrequestexpression
---

# NSFetchRequestExpression

An expression that evaluates the result of a fetch request on a managed object context.

## Declaration

```swift
class NSFetchRequestExpression
```

## Overview

Overview NSFetchRequestExpression inherits from NSExpression, which provides most of the basic behavior. The first argument must be an expression which evaluates to an NSFetchRequest object, and the second must be an expression which evaluates to an NSManagedObjectContext object. If you simply want the count for the request, the countOnly argument should be true.

## Topics

### Creating a Fetch Request Expression

- [expression(forFetch:context:countOnly:)](coredata/nsfetchrequestexpression/expression(forfetch:context:countonly:).md)

### Examining a Fetch Request Expression

- [requestExpression](coredata/nsfetchrequestexpression/requestexpression.md)
- [contextExpression](coredata/nsfetchrequestexpression/contextexpression.md)
- [isCountOnlyRequest](coredata/nsfetchrequestexpression/iscountonlyrequest.md)

### Constants

- [NSFetchRequestExpressionType](coredata/nsfetchrequestexpressiontype.md)

## Relationships

### Inherits From

- [NSExpression](foundation/nsexpression.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Specifying Fetch Constraints

- [predicate](coredata/nsfetchrequest/predicate.md)
- [fetchLimit](coredata/nsfetchrequest/fetchlimit.md)
- [fetchOffset](coredata/nsfetchrequest/fetchoffset.md)
- [fetchBatchSize](coredata/nsfetchrequest/fetchbatchsize.md)
- [affectedStores](coredata/nsfetchrequest/affectedstores.md)
- [NSExpressionDescription](coredata/nsexpressiondescription.md)
- [NSFetchedPropertyDescription](coredata/nsfetchedpropertydescription.md)
