summaryrefslogtreecommitdiff
path: root/jstests/index6.js
blob: 8dbd8f74fcf70c98d5a5133f4c6602aa61ecad8d (plain)
1
2
3
4
5
6
7
8
// index6.js Test indexes on array subelements.

r = db.ed.db.index6;
r.drop();

r.save( { comments : [ { name : "eliot", foo : 1 } ] } );
r.ensureIndex( { "comments.name": 1 } );
assert( r.findOne( { "comments.name": "eliot" } ) );