Unverified Commit 86079773 authored by Sebastian Castro's avatar Sebastian Castro
Browse files

add mongo operation example

parent 6ed65125
...@@ -111,4 +111,16 @@ db.Configuration.updateMany( { } , { $set: { 'defautTileLayer': DBRef("TileLayer ...@@ -111,4 +111,16 @@ db.Configuration.updateMany( { } , { $set: { 'defautTileLayer': DBRef("TileLayer
// Reset duplicates // Reset duplicates
db.Element.updateMany({moderationState: 4}, {$set: {moderationState: 0, isDuplicateNode: false}, $unset: { potentialDuplicates: 1} }) db.Element.updateMany({moderationState: 4}, {$set: {moderationState: 0, isDuplicateNode: false}, $unset: { potentialDuplicates: 1} })
db.MigrationState.updateMany({}, { $set: { migrationIndex: 0}}) db.MigrationState.updateMany({}, { $set: { migrationIndex: 0}})
\ No newline at end of file
db.Element.find({'data.image': {$exists: true}}).forEach(function(e) {
newImage = {
externalImageUrl: e.data.image.replace('http://', 'https://'),
updatedAt: ISODate("2020-02-14T00:00:01Z")
};
images = e.images || [];
images.push(newImage);
e.images = images;
delete e.data.image;
db.Element.save(e);
});
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment