Repository navigation
feat(collection): add update for PATCH /collections/{name} - #51
Merged
haydenhoang merged 3 commits intoNov 10, 2026
Merged
haydenhoang merged 3 commits into
haydenhoang merged 3 commits into
Conversation
Collaborator
|
Hey @tharropoulos , the latest upstream spec already makes - public var fields: [Field]
+ public var fields: [Field]?
...
- public init(fields: [Field], synonymSets: [String]? = nil, metadata: AnyCodable? = nil) {
+ public init(fields: [Field]? = nil, synonymSets: [String]? = nil, metadata: AnyCodable? = nil) {
...
- try container.encode(fields, forKey: .fields)
+ try container.encodeIfPresent(fields, forKey: .fields)Then:
|
tharropoulos
force-pushed
the
fix/truncate-and-collection-update
branch
from
November 10, 2026 10:31
713cc9e to
d5ab258
Compare
Contributor
Author
|
cc: @haydenhoang |
haydenhoang
approved these changes
Nov 10, 2026
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Collection.update(schema:), which sendsPATCH /collections/{name}and decodes the response as the type passed inCodablebody becauseCollectionUpdateSchemarequiresfields, and that blocks updates that only touchmetadataorsynonym_setstestCollectionUpdateto drop and add a field, andtestCollectionUpdateMetadataOnlyto check that a metadata-only patch leaves all 4 fields in placetestDocumentsTruncateto covertruncate: truethrough the existingdocuments().delete(options:), which needed no source changefilterBywhentruncateis set