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
See: https://docs.mongodb.com/manual/tutorial/query-arrays/#query-for-an-element-by-the-array-index-position
Example query:
const inventory = db.collection('inventory') await inventory.insertMany([ { item: "journal", qty: 25, tags: ["blank", "red"], dim_cm: [ 14, 21 ] }, { item: "notebook", qty: 50, tags: ["red", "blank"], dim_cm: [ 14, 21 ] }, { item: "paper", qty: 100, tags: ["red", "blank", "plain"], dim_cm: [ 14, 21 ] }, { item: "planner", qty: 75, tags: ["blank", "red"], dim_cm: [ 22.85, 30 ] }, { item: "postcard", qty: 45, tags: ["blue"], dim_cm: [ 10, 15.25 ] } ]) await inventory.find( { "dim_cm.1": { $gt: 25 } } ).toArray()
I will probably provide a test for this soon and see if I can fix it.
The text was updated successfully, but these errors were encountered:
This worked for me, but only when querying an array of embedded documents. db.users.find( { 'info.0.follows_viewer': true } )
db.users.find( { 'info.0.follows_viewer': true } )
while this didn't work: db.users.find( { 'info.follows_viewer': true } )
db.users.find( { 'info.follows_viewer': true } )
Sorry, something went wrong.
No branches or pull requests
See: https://docs.mongodb.com/manual/tutorial/query-arrays/#query-for-an-element-by-the-array-index-position
Example query:
I will probably provide a test for this soon and see if I can fix it.
The text was updated successfully, but these errors were encountered: