Skip to content

Commit fcd1dab

Browse files
authored
Update createQuery API (#623)
Per changes in CBL-2452 that removes the query param tag, update createQuery() API call accordingly.
1 parent 15c0a71 commit fcd1dab

File tree

2 files changed

+7
-15
lines changed

2 files changed

+7
-15
lines changed

modules/swift/examples/code_snippets/Query.swift

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -289,10 +289,8 @@ class Query {
289289
// tag::query-syntax-n1ql[]
290290
let db = try! Database(name: "hotel")
291291

292-
let listQuery = db.createQuery( query:
293-
"SELECT META().id AS thisId FROM \(db.name) WHERE type = 'hotel'" // <.>
294-
)
295-
292+
let listQuery = db.createQuery("SELECT META().id AS thisId FROM \(db.name) WHERE type = 'hotel'") // <.>
293+
296294
let results: ResultSet = try listQuery.execute()
297295

298296
// end::query-syntax-n1ql[]
@@ -310,9 +308,7 @@ class Query {
310308
let db = try! Database(name: "hotel")
311309

312310
let listQuery =
313-
db.createQuery( query:
314-
"SELECT META().id AS thisId FROM _ WHERE type = $type" // <.>
315-
)
311+
db.createQuery("SELECT META().id AS thisId FROM _ WHERE type = $type") // <.>
316312

317313
listQuery.parameters =
318314
Parameters().setString("hotel", forName: "type") // <.>

modules/swift/examples/code_snippets/SampleCodeTest.swift

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2474,10 +2474,8 @@ class Query {
24742474
// tag::query-syntax-n1ql[]
24752475
let db = try! Database(name: "hotel")
24762476

2477-
let listQuery = db.createQuery( query:
2478-
"SELECT META().id AS thisId FROM _ WHERE type = 'hotel'" // <.>
2479-
)
2480-
2477+
let listQuery = db.createQuery("SELECT META().id AS thisId FROM _ WHERE type = 'hotel'") // <.>
2478+
24812479
let results: ResultSet = try listQuery.execute()
24822480

24832481
// end::query-syntax-n1ql[]
@@ -2495,10 +2493,8 @@ class Query {
24952493
let db = try! Database(name: "hotel")
24962494

24972495
let listQuery =
2498-
db.createQuery( query:
2499-
"SELECT META().id AS thisId FROM _ WHERE type = $type" // <.>
2500-
)
2501-
2496+
db.createQuery("SELECT META().id AS thisId FROM _ WHERE type = $type") // <.>
2497+
25022498
listQuery.parameters =
25032499
Parameters().setString("hotel", forName: "type") // <.>
25042500

0 commit comments

Comments
 (0)