<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.10.0 -",
    "swift: 4.2.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: -",
    "watchOS: 3.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CloudKit",
  "identifier" : "/documentation/CloudKit/CKModifyRecordsOperation/init(recordsToSave:recordIDsToDelete:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "CloudKit"
    ],
    "preciseIdentifier" : "s:So24CKModifyRecordsOperationC8CloudKitE13recordsToSave09recordIDsG6DeleteABSaySo8CKRecordCGSg_SaySo0L2IDCGSgtcfc"
  },
  "title" : "init(recordsToSave:recordIDsToDelete:)"
}
-->

# init(recordsToSave:recordIDsToDelete:)

Creates an operation for modifying the specified records.

```
convenience init(recordsToSave: [CKRecord]? = nil, recordIDsToDelete: [CKRecord.ID]? = nil)
```

## Parameters

`recordsToSave`

The records to save. You can specify `nil` for this parameter.

`recordIDsToDelete`

The IDs of the records to delete. You can specify `nil` for this parameter.

## Discussion

The records that you intend to save or delete must all reside in the same database, which you specify when you configure the operation. If your app saves a record in a database that doesn’t exist, the server creates the database.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)