Skip to content

Commit

Permalink
Support parameter in bracket #8
Browse files Browse the repository at this point in the history
  • Loading branch information
pikami committed Dec 25, 2024
1 parent 39cd9e2 commit 928ca29
Show file tree
Hide file tree
Showing 6 changed files with 1,405 additions and 1,306 deletions.
15 changes: 15 additions & 0 deletions api/tests/documents_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,21 @@ func Test_Documents(t *testing.T) {
)
})

t.Run("Should query document with query parameters as accessor", func(t *testing.T) {
testCosmosQuery(t, collectionClient,
`select c.id
FROM c
WHERE c[@param]="67890"
ORDER BY c.id`,
[]azcosmos.QueryParameter{
{Name: "@param", Value: "id"},
},
[]interface{}{
map[string]interface{}{"id": "67890"},
},
)
})

t.Run("Should query array accessor", func(t *testing.T) {
testCosmosQuery(t, collectionClient,
`SELECT c.id,
Expand Down
Loading

0 comments on commit 928ca29

Please sign in to comment.