Azure Cosmos DB
https://gyazo.com/951d4e5964de7985c92a143a79c141b9
あらゆるスケールに対応するグローバル分散型マルチモデル Database データベース サービス
Azure Cosmos DB – マルチモデル データベース サービス | Microsoft Azure
ディレクトリ
Azure Cosmos DB アカウント
コンテナa
ドキュメントx
ドキュメントy
コンテナb
作成時注意
パーティションkeyは、/id にすること
c# - Cosmodb : "message":"Syntax error, invalid numeric value token '4d5f'." error - Stack Overflow
クエリ
Azure Cosmos DB での SQL クエリの実行 | Microsoft Docs
Azure Cosmos DB SQL API 用の SQL クエリ メトリック | Microsoft Docs
Azure Cosmos DB インデックス作成ポリシー | Microsoft Docs
例
code:query.js
query: "SELECT * FROM c where c.deviceId in (" + deviceIds + ") AND c.timeStamp >= @startTime AND c.timeStamp <= @endTime ",
parameters : [
// 注 {},{}...な形
{ name: '@startTime', value: startTime},
{name: '@endTime', value: endTime}
]
注意
BETWEENダメ
in は"a,b,c..."文字列で渡す
エンティティ階層
https://docs.microsoft.com/ja-jp/azure/cosmos-db/media/databases-containers-items/cosmos-entities.png
Azure Cosmos DB のデータベース、コンテナー、項目の操作 | Microsoft Docs
ドキュメントURL
RESTful APIでアクセス可能
code:cosmos.js
get(https://{databaseaccount}.documents.azure.com/dbs/{db-id}/colls/{coll-id}/docs/{doc-id})
Note that the {databaseaccount} is the name of the Azure Cosmos DB account created under your subscription.
The {db-id} value is the user generated name/ID of the database, not the system generated ID (rid).
The {coll-id} value is the name of the collection. The {doc-id} value is the ID of the document to be retrieved.
Azure Cosmos DB Resource URI Syntax for REST | Microsoft Docs
Get a Document - Azure Cosmos DB REST API | Microsoft Docs
Azure Cosmos DB入門(3) - ryuichi111stdの技術日記
結局
Azure Functionsで返すようにした。
metadata系は、これが適切?
Azure Blob Storageみたいな利用と言える。
codmosDBには、cosmosが自動で入れるparmもあるので、これが適切?
hr.icon
参考
Azure Cosmos DB のキホンと使いドコロ
Azure Cosmos DB入門(目次) - ryuichi111stdの技術日記
古いけど良い
公式チュートリアル
Azure Cosmos DB:JavaScript SDK を使用して Node.js アプリをビルドして Azure Cosmos DB SQL API データを管理する | Microsoft Docs
✅チュートリアル: JavaScript SDK を使用して Node.js Web アプリをビルドして Azure Cosmos DB SQL API データを管理する | Microsoft Docs