Skip to content

Commit

Permalink
don’t encode empty stages
Browse files Browse the repository at this point in the history
  • Loading branch information
tayloraswift committed Jan 8, 2024
1 parent 1e1c889 commit 8097b21
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 8097b21

Please sign in to comment.