---
title: "metadataForPersistentStore(with:)"
framework: coredata
role: symbol
role_heading: Type Method
path: "coredata/nspersistentstorecoordinator/metadataforpersistentstore(with:)"
---

# metadataForPersistentStore(with:)

Returns a dictionary that contains the metadata stored in the persistent store at the specified location.

## Declaration

```swift
class func metadataForPersistentStore(with url: URL) throws -> [AnyHashable : Any]
```

## Parameters

- `url`: An URL object that specifies the location of a persistent store.

## Return Value

Return Value A dictionary containing the metadata for the persistent store at url. If no store is found, or there is a problem accessing its contents, returns nil. The keys guaranteed to be in this dictionary are NSStoreTypeKey and NSStoreUUIDKey.

## Discussion

Discussion This method allows you to access the metadata in a persistent store without initializing a Core Data stack.

## See Also

### Related Documentation

- [setMetadata(_:for:)](coredata/nspersistentstorecoordinator/setmetadata(_:for:).md)
- [metadata(for:)](coredata/nspersistentstorecoordinator/metadata(for:).md)

### Deprecated type methods

- [elementsDerived(fromExternalRecordAt:)](coredata/nspersistentstorecoordinator/elementsderived(fromexternalrecordat:).md)
- [metadataForPersistentStore(ofType:at:)](coredata/nspersistentstorecoordinator/metadataforpersistentstore(oftype:at:).md)
- [metadataForPersistentStore(ofType:at:options:)](coredata/nspersistentstorecoordinator/metadataforpersistentstore(oftype:at:options:).md)
- [registerStoreClass(_:forStoreType:)](coredata/nspersistentstorecoordinator/registerstoreclass(_:forstoretype:).md)
- [removeUbiquitousContentAndPersistentStore(at:options:)](coredata/nspersistentstorecoordinator/removeubiquitouscontentandpersistentstore(at:options:).md)
- [setMetadata(_:forPersistentStoreOfType:at:)](coredata/nspersistentstorecoordinator/setmetadata(_:forpersistentstoreoftype:at:).md)
- [setMetadata(_:forPersistentStoreOfType:at:options:)](coredata/nspersistentstorecoordinator/setmetadata(_:forpersistentstoreoftype:at:options:).md)
