Last active
December 31, 2015 06:19
-
-
Save simark/7946448 to your computer and use it in GitHub Desktop.
Database update
This file contains hidden or 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
// Enlever prix/quantités usagé | |
db.pieces.update({_id: {$exists: true}}, { $rename: {'prixneuf':'prix', 'quantiteneuf':'quantite'}, $unset: {'quantiteusage': true, 'prixusage': true} }, {multi: true}) | |
// Trouver factures problématiques | |
db.factures.find({ 'pieces': {$elemMatch: { 'quantiteusage': {$exists: true}, 'quantiteneuf': {$exists: true} }} }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment