Created
December 2, 2015 11:20
-
-
Save zladuric/52bba4c15872c389a026 to your computer and use it in GitHub Desktop.
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
// Create something to test | |
db.test.insert({deep: {prop: 5}}); | |
// Rename field | |
db.test.update({'deep.prop': {$exists: true}}, {$rename: {'deep.prop': 'deep.property'}}, {multi: true}); | |
// Move to another object | |
// Note: leaves dangling `deep: {}` | |
db.test.update({'deep.property': {$exists: true}}, {$rename: {'deep.property': 'deeper.deep.property'}}, {multi: true}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment