We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fa27cdf commit 7c6e278Copy full SHA for 7c6e278
Sources/UnidocDB/Packages/Unidoc.AliasQuery.swift
@@ -5,7 +5,7 @@ import UnidocRecords
5
extension Unidoc
6
{
7
/// A query that adds a new alias to the specified `Aliases` collection by looking up and
8
- /// branching from an existing alias.
+ /// branching from an existing alias. If the alias already exists, the query does nothing.
9
struct AliasQuery<Aliases>:Sendable
10
where Aliases:Mongo.CollectionModel,
11
Aliases.Element:MongoMasterCodingModel<Unidoc.AliasKey>
@@ -50,7 +50,7 @@ extension Unidoc.AliasQuery:Mongo.PipelineQuery
50
$0[.into] = Aliases.name
51
$0[.on] = Aliases.Element[.id]
52
$0[.whenNotMatched] = .insert
53
- $0[.whenMatched] = .fail
+ $0[.whenMatched] = .keepExisting
54
}
55
56
0 commit comments