Skip to content

Commit d67a899

Browse files
committed
Mongo indexes
1 parent c0ff231 commit d67a899

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

mongo/indexes

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# List existing indexes
2+
> db.bands.getIndexes()
3+
4+
# Create index
5+
> db.bands.createIndex( { year_started: 1 }, {name: "year started index"} )
6+
7+
# Create descending index
8+
> db.bands.createIndex( { year_started: -1 }, {name: "descending year started index"} )

0 commit comments

Comments
 (0)