Reputation: 343
I am currently using MongoChef (4.3.0) to access an Azure Document DB (using DocumentDB protocol support for MongoDB).
The data in question is from an Application Insights continuous export has the following type of data within (there is other data there but this is the key part i am interested in...)
{
... other fields ...
"request" : [
{
"name" : "GET /images/loading_man.gif",
"count" : NumberInt(1),
"responseCode" : NumberInt(200),
"success" : NumberInt(1),
"url" : "http://<removed>.cloudapp.azure.com/<something>/images/loading_man.gif"
... other fields ...
}
]
... other fields ...
}
Using MongoChef I can perform some basic query like the following without issue;
{ "request": { $exists: true } }
but anything more complicated seems to return nothing or not run at all
{ "request.0.url": { $exists: true } }
{ "request.0.url": /.*man.*/i }
If I Export this data and Import it to my local MongoDb I am indeed able to perform such searches on the data in question without issue.
Any ideas how I could perform this type of search on the data in question without needing to export it?.
(this is a programming issue, because I want to do the above in a python program!)
Upvotes: 2
Views: 133
Reputation: 343
Well it looks like all I needed to do was use $elemMatch!
{ "request": { $elemMatch: {url:/.*man.*/i } }}
this is as I understand the recommended way but also 'faster'?
Upvotes: 1