Last active
November 24, 2018 22:28
-
-
Save stephencweiss/1feb3d3fba6fef47590c8c3ab7efd47d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
db.descriptions.find( { productId: 1928222 } ) | |
db.descriptions.find( { productId: { $gt : 9999990 } } ) |
Author
stephencweiss
commented
Nov 21, 2018
Because the productId
field has been indexed, Mongo is able to go directly to the record and retrieve it. This is evident by the fact that only 1 document was examined in the specific ID lookup and 10 in the $gt
lookup.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment