Skip to content

Commit a02e290

Browse files
authored
ArrayIndexConfiguration explicit expressions arg on set (#3342)
1 parent 72b9f86 commit a02e290

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

Swift/IndexConfiguration.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public struct ArrayIndexConfiguration: IndexConfiguration, IndexConfigConvertabl
8888
/// represents an expression defining the values within the array to be indexed.
8989
/// If the array specified by the path contains scalar values, this parameter can be null.
9090
/// - Returns The ArrayIndexConfiguration object.
91-
public init(path: String, _ expressions: [String]? = nil) {
91+
public init(path: String, expressions: [String]? = nil) {
9292
if let expressions = expressions {
9393
if expressions.isEmpty || (expressions.count == 1 && expressions[0].isEmpty) {
9494
NSException(name: .invalidArgumentException,

Swift/Tests/UnnestArrayTest.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ class UnnestArrayTest: CBLTestCase {
3333
/// 2. Check that an invalid arument exception is thrown.
3434
func testArrayIndexConfigInvalidExpressions() throws {
3535
expectException(exception: .invalidArgumentException) {
36-
_ = ArrayIndexConfiguration(path: "contacts", [])
36+
_ = ArrayIndexConfiguration(path: "contacts", expressions: [])
3737
}
3838

3939
expectException(exception: .invalidArgumentException) {
40-
_ = ArrayIndexConfiguration(path: "contacts", [""])
40+
_ = ArrayIndexConfiguration(path: "contacts", expressions: [""])
4141
}
4242
}
4343

@@ -76,7 +76,7 @@ class UnnestArrayTest: CBLTestCase {
7676
func testCreateArrayIndexWithPathAndExpressions() throws {
7777
let profiles = try db.createCollection(name: "profiles")
7878
try loadJSONResource("profiles_100", collection: profiles)
79-
let config = ArrayIndexConfiguration(path: "contacts", ["address.city", "address.state"])
79+
let config = ArrayIndexConfiguration(path: "contacts",expressions: ["address.city", "address.state"])
8080
try profiles.createIndex(withName: "contacts", config: config)
8181
let indexes = try profiles.indexesInfo()
8282
XCTAssertEqual(indexes!.count, 1)

0 commit comments

Comments
 (0)