Skip to content

Instantly share code, notes, and snippets.

@ivancorrales

ivancorrales/database.hcl

Last active Feb 17, 2021
Embed
What would you like to do?
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