Algolia Swift Client : Partial Update Object, Multiple Attributes

I’m confused regarding how Partial Update Object works now in the Swift Algolia client.

I want to partially update an object and change multiple (not all) attributes without having to use Save Object. I could do this easily in the previous version by providing my own JSON object and use the partial update method. Things have changed with v8!

The documentation does not provide an example of changing multiple attributes for a single object, but it says it can. All I see is this:

index.partialUpdateObject(withID: "myID", with: .update(attribute: "city", value: "San Francisco")) { result in if case .success(let response) = result { print("Response: \(response)") }

That’s great if I only want to update city. But what if I wanted to update city and some other attribute? Say I have an object for a customer named Bob. I’ve changed his city, but how do I change his age and city? I feel like I’m missing something obvious, but would appreciate a point in the right direction.

Hi @yulelogsean,

Thank you for reporting this issue.
You are right that in the v8 the Partial Update operation has significantly changed and the possibility to update multiple fields with one JSON object is missing now.
We will restore this feature in the next release of the client.
In the meantime you can use index.partialUpdateObjects method which batches multiple per-attribute update operations in one call.

Great! Otherwise this method would be almost useless to me. I appreciate the work you guys do.

Just an update: this issue was addressed in the 8.10 release of the Swift API client. Thanks for the quick fix! Hopefully we will see this release integrated into v7 of Instant Search for iOS.