Skip to content

Instantly share code, notes, and snippets.

View dwainbrowne's full-sized avatar

Dwain Browne dwainbrowne

View GitHub Profile
@dwainbrowne
dwainbrowne / Cosmos DB SQL queries.md
Created July 15, 2023 08:35 — forked from mifung/Cosmos DB SQL queries.md
Cheat Sheet for Cosmos DB SQL queries

Notes

  • Search text is case sensitive
  • Try to force attribute and text in your search to be in the same case
  • Wildcard search use STARTSWITH and ENDSWITH
  • two different types of nulls:
  • missing elements
  • actual null values.
  • Use IS_NULL()and IS_DEFINED() functions, to detect missing attributes and ternary logic
  • Cosmos DB SQL currently does not have an equivalent of SQL LEFT() function. Instead, use SUBSTRING()
  • There is no Year() function in Cosmos DB SQL, use SUBSTRING() to the date string and isolate