c# - DocumentDb cannot handle hyphen (-) in column names -
i saving following xml documentdb:
<documentdbtest_countries> <country>c25103657983</country> <language>c25103657983</language> <countrycode>383388823</countrycode> <version>2015-08-25t08:36:59:982.3552</version> <integrity> <hash-algorithm>sha1</hash-algorithm> <hash /> </integrity> <context-info> <created-by>unittestuser</created-by> <created-on>2015/08/25 08:36:59</created-on> <created-time-zone>utc</created-time-zone> <modified-by>unittestuser</modified-by> <modified-on>2015/08/25 08:36:59</modified-on> <modified-time-zone>utc</modified-time-zone> </context-info> </documentdbtest_countries>
which gets saved fine documentdb following:
{ "documentdbtest_countries": { "integrity": { "hash-algorithm": "sha1", "hash": "" }, "context-info": { "created-by": "unittestuser", "created-on": "2015/08/25 08:36:59", "created-time-zone": "utc", "modified-by": "unittestuser", "modified-on": "2015/08/25 08:36:59", "modified-time-zone": "utc" }, "country": "c25103657983", "language": "c25103657983", "countrycode": 383388823, "version": "2015-08-25t08:36:59:982.3552" }, "id": "f917945d-eaee-4eff-944d-dae366de7be1" }
as can see column name indeed saved hyphen (-) in in documentdb (without kind of errors/exceptions/warning apparently) when try lookup fails in query explorer. seems there no way search on hyphenated column names. true? or, missing something? can please point me documentation limitation somewhere??
for field names use characters (space, "@", "-", etc.) or conflict sql keywords, have use quoted property accessor syntax. instead of writing:
select * c c.context-info.created-by = "unittestuser"
write:
select * c c["context-info"]["created-by"] = "unittestuser"
Comments
Post a Comment