Open Szeraax opened 2 years ago
Ok, so this cmdlet just passes through the hashtable directly as seen here: https://github.com/PlagueHO/CosmosDB/blob/7ca25c5037b72268e53cdbbb4e261b171fca5c79/source/Public/documents/Get-CosmosDbDocumentJson.ps1#L146
Here is a proof of concept for what would need done to translate parameters to always be lower case:
$QueryParameters = $QueryParameters | %{
$ht = @{}
$_.getenumerator() | %{
$ht.add($_.Name.ToLower(),$_.Value)
}
$ht
}
I'd expect the performance hit to be quite minimal if implemented. Alternatively, it could be nice to check if the hashtable array contains any name or value keys that aren't fully lower case and error if so. Thoughts on what direction you'd like to go?
Hi @Szeraax - ah yes, I see what you mean. It doesn't specifically call this out in the docs (https://docs.microsoft.com/en-us/rest/api/cosmos-db/query-documents), but makes sense. The fix makes sense, but just would need slight style adjustments. What I'd also suggest is moving the whole code block to a helper function that we can put unit tests on (just makes testing easier). Happy to do this or take a PR if you want?
I have to do lower case name and value keys in each hashtable.
If I do upper case NAME, I get the error:
If I do upper case VALUE, I get no results.
Will start digging into code shortly.