Skip to content

Instantly share code, notes, and snippets.

@Hasstrup
Last active December 29, 2018 21:31
Show Gist options
  • Save Hasstrup/92d37da41181faf57bd962fa9f97e9a6 to your computer and use it in GitHub Desktop.
Save Hasstrup/92d37da41181faf57bd962fa9f97e9a6 to your computer and use it in GitHub Desktop.
Index
package main
import "flag"
var (
cmd = flag.String("cmd", "", "list or add?")
address = flag.String("address", "", "mongodb address to connect to")
database = flag.String("db", "", "The name of the database to connect to")
collection = flag.String("collection", "", "The collection (in the db) to connect to")
key = flag.String("field", "", "The field you'd like to place an index on")
unique = flag.Bool("unique", false, "Would you like the index to be unique?")
value = flag.Int("type", 1, "would you like the index to be ascending (1) or descending (-1)?")
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment