data <- dbGetQueryForKeys(mongoConn,"collect","{'data.LoadPct':{'$gt':10}}","{'data.LoadPct':1}")
and data return
data.LoadPct X_id
1 NA 5298400b7dbf497a8bb0192d
2 NA 5298404d7dbf497a8bb01942
3 NA 5298408c7dbf497a8bb019a2
4 NA 529840cc7dbf497a8bb019f5
5 NA 529840d17dbf497a8bb019fc
.....
other code
data <- dbGetQueryForKeys(mongoConn,"collect","{'data.LoadPct':{'$gt':10}}","{'data':1,data.LoadPct:1}")
result
data data.LoadPct X_id
1 [ { "LoadPct" : 59}] NA 5298400b7dbf497a8bb0192d
2 [ { "LoadPct" : 24}] NA 5298404d7dbf497a8bb01942
3 [ { "LoadPct" : 50}] NA 5298408c7dbf497a8bb019a2
4 [ { "LoadPct" : 22}] NA 529840cc7dbf497a8bb019f5
5 [ { "LoadPct" : 11}] NA 529840d17dbf497a8bb019fc
.....
Here is my data test store in MongoDB
I can not perform a query to get data like result of following query when i run it on mongo shell
My R-Code to get result like above query
and data return
other code
result