Skip to content

Instantly share code, notes, and snippets.

@burntblark
Last active January 10, 2018 05:33
Show Gist options
  • Save burntblark/dac068a3430520129d4544479fa8d387 to your computer and use it in GitHub Desktop.
Save burntblark/dac068a3430520129d4544479fa8d387 to your computer and use it in GitHub Desktop.
// Remove column(s) from a collection
db.collection.update(
{},
{ $unset:
{
field:1
}
} , {
multi: true
}
);
// Add or update columns in a collection
db.guardian.update(
{},
{ $set:
{
status: 'active'
}
}, {multi: true}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment