forked from liukgg/study_notes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
mongodb创建索引时指定1或-1的作用(ascending and desending) | ||
=============================================================== | ||
|
||
概要 | ||
------------------------------------------ | ||
|
||
- 对于单列索引,1和-1是等效的,没有影响。 | ||
|
||
- 对于复合索引,1和-1会决定,到底哪些排序会能用到索引。 | ||
|
||
举例说明 | ||
---------------------------------------------- | ||
http://stackoverflow.com/questions/10329104/why-does-direction-of-index-matter-in-mongodb | ||
|
||
参考: | ||
--------------------------------------------- | ||
|
||
http://stackoverflow.com/questions/10329104/why-does-direction-of-index-matter-in-mongodb | ||
|
||
https://docs.mongodb.com/manual/core/index-compound/#index-ascending-and-descending |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters