I am exploring Azure CosmosDB and having trouble with understanding how I can query my collection. I created a web application to add and query the data but I want to search within Azure and do not know how I should structure my query.
Currently I query my collection running to return everything.
SELECT * FROM c
This returns a lot of information. Here is a sample of what the data looks like.
{
"$t": 3,
"$v": {
"searchTerm": {
"$t": 2,
"$v": "test"
},
"searchDate": {
"$t": 9,
"$v": 1501606675858
},
"_id": {
"$t": 7,
"$v": "Y³\u0013&Ò#\bø\u0005+ú"
},
"__v": {
"$t": 16,
"$v": 0
}
},
"id": "NTk4MGIzMTMyNmQyMjMwOGY4MDUyYmZh",
"_rid": "pR8YAPXxJQABAAAAAAAAAA==",
"_self": "dbs/pR8YAA==/colls/pR8YAPXxJQA=/docs/pR8YAPXxJQABAAAAAAAAAA==/",
"_etag": "\"020094b9-0000-0000-0000-5980b3130000\"",
"_attachments": "attachments/",
"_ts": 1501606672 }
Is there a way to just query for a certain "searchTerm" (a field within my CosmosDB). I cannot seem to grasp the Syntax to filter down my query. I have tried a combination of things that would seem to make sense in SQL but none of it is working.
Thanks for any help.
documentdb sqlordocumentdb queriesshould give you everything you need to get started. - David Makogon