Skip to content

Commit

Permalink
added array handling
Browse files Browse the repository at this point in the history
  • Loading branch information
valeriomazzeo committed Mar 19, 2019
1 parent c9a3ac7 commit 52fae31
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Sources/FluentMongo/Document+Nested.swift
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,12 @@ extension Document {
switch document[item.key] {
case .some(let value as Document):
mutableFilter[ensureNoRootNameSpace(item.key)] = removeKeysPrefix(value)
case .some(let value as [Document]):
mutableFilter[ensureNoRootNameSpace(item.key)] = value.map { removeKeysPrefix($0) }
case .some(let value):
mutableFilter[ensureNoRootNameSpace(item.key)] = value
case .none:
break
mutableFilter[ensureNoRootNameSpace(item.key)] = nil
}
}

Expand Down

0 comments on commit 52fae31

Please sign in to comment.