Created
April 9, 2018 14:58
-
-
Save luisfranciscocesar/bc0e41f804efd339ec01d5860df37def to your computer and use it in GitHub Desktop.
Crear indice para mongodb.
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
# crea el indice para buscar texto en el campo. | |
db.getCollection('mi_collection').createIndex( { "CAMPO": "text" } ) | |
# busca un texto en el campo de el indice creado | |
db.getCollection('mi_collection').find( { $text: { $search: "MI NOMBRE ES" } } ) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment