mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 01:21:03 +01:00
9 lines
233 B
JavaScript
9 lines
233 B
JavaScript
// index6.js Test indexes on array subelements.
|
|
|
|
r = db.ed.db.index5;
|
|
r.drop();
|
|
|
|
r.save( { comments : [ { name : "eliot", foo : 1 } ] } );
|
|
r.ensureIndex( { "comments.name": 1 } );
|
|
assert( r.findOne( { "comments.name": "eliot" } ) );
|