Skip to content

Commit

Permalink
Merge pull request #112 from tayloraswift/0.9.2
Browse files Browse the repository at this point in the history
don’t encode empty $unset stages
  • Loading branch information
tayloraswift authored Jan 8, 2024
2 parents 1e1c889 + 8097b21 commit 5af36cb
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Sources/MongoBuiltins/Pipelines/Mongo.PipelineEncoder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -677,15 +677,14 @@ extension Mongo.PipelineEncoder
}
}
}
/// Does nothing if the assigned array is empty.
@inlinable public
subscript(key:Mongo.Pipeline.Unset) -> [Mongo.KeyPath]?
subscript(key:Mongo.Pipeline.Unset) -> [Mongo.KeyPath]
{
get { nil }
get { [ ] }
set (value)
{
guard
let value:[Mongo.KeyPath]
else
if value.isEmpty
{
return
}
Expand Down

0 comments on commit 5af36cb

Please sign in to comment.