Skip to content

Instantly share code, notes, and snippets.

@ivancorrales
Last active February 17, 2021 07:09
Show Gist options
  • Save ivancorrales/2e5e9f66b6c2209f2efafe7132eecd69 to your computer and use it in GitHub Desktop.
Save ivancorrales/2e5e9f66b6c2209f2efafe7132eecd69 to your computer and use it in GitHub Desktop.
func dropCollection {
input {
arg mongoUri {
description = "mongo uri"
}
arg database {
description = "Name of the database"
default = "admin"
}
arg collection {
description = "Name of the collection"
default = "users"
}
arg credentials {
description = "A object with two attributes: username & password"
}
}
body {
mongo drop {
connection {
uri = mongoUri
auth scram-sha-1{
username = credentials.username
password = credentials.password
}
}
query {
database = database
collection = collection
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment