<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.10.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 3.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CloudKit",
  "identifier" : "/documentation/CloudKit/CKDatabase/add(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "CloudKit"
    ],
    "preciseIdentifier" : "c:objc(cs)CKDatabase(im)addOperation:"
  },
  "title" : "add(_:)"
}
-->

# add(_:)

Executes the specified operation in the current database.

```
func add(_ operation: CKDatabaseOperation)
```

## Parameters

`operation`

The operation to execute.

## Discussion

Configure the operation fully before you call this method. Prior to the operation executing, CloudKit sets its [`database`](/documentation/CloudKit/CKDatabaseOperation/database) property to the current database. The operation executes at the priority and quality of service (QoS) that you specify using the <doc://com.apple.documentation/documentation/Foundation/Operation/queuePriority-swift.property> and <doc://com.apple.documentation/documentation/Foundation/Operation/qualityOfService> properties.

---

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)