We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Considering this example collection:
students <- mongo("students") students$insert(c( '{ "student" : 1, "grades" : [ 95, 92, 90 ] }', '{ "student" : 2, "grades" : [ 98, 100, 102 ] }', '{ "student" : 3, "grades" : [ 95, 110, 100] }'))
I am trying to get from all documents the first element in grade. I tried the following, but this gives as output NULL
students$find(query = '{}', fields = '{"grades.0" : true}')
Why doesn't this work in the field operator, as it does work in the query part when looking for the student with the first grade 98:
students$find(query = '{"grades.0" : 98}', fields = '{"student" : true}')
I don't understand what I do wrong. Thanks for your help!
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Considering this example collection:
students <- mongo("students") students$insert(c( '{ "student" : 1, "grades" : [ 95, 92, 90 ] }', '{ "student" : 2, "grades" : [ 98, 100, 102 ] }', '{ "student" : 3, "grades" : [ 95, 110, 100] }'))
I am trying to get from all documents the first element in grade. I tried the following, but this gives as output NULL
students$find(query = '{}', fields = '{"grades.0" : true}')
Why doesn't this work in the field operator, as it does work in the query part when looking for the student with the first grade 98:
students$find(query = '{"grades.0" : 98}', fields = '{"student" : true}')
I don't understand what I do wrong. Thanks for your help!
The text was updated successfully, but these errors were encountered: