Commit 265ceeab by Brian Beggs

Updated context revert migration to use bulk operations

parent 634612a5
...@@ -3,9 +3,7 @@ db.contents.dropIndex({ _type: 1, course_id: 1, context: 1, pinned: -1, created_ ...@@ -3,9 +3,7 @@ db.contents.dropIndex({ _type: 1, course_id: 1, context: 1, pinned: -1, created_
db.contents.dropIndex({ _type: 1, commentable_id: 1, context: 1, pinned: -1, created_at: -1 }) db.contents.dropIndex({ _type: 1, commentable_id: 1, context: 1, pinned: -1, created_at: -1 })
print ("Removing context from all comment threads\n"); print ("Removing context from all comment threads\n");
db.contents.update( var bulk = db.contents.initializeUnorderedBulkOp();
{_type: "CommentThread"}, bulk.find( {_type: "CommentThread", context: {$exists: true}} ).update( {$unset: {context: ""}} );
{$unset: {context: ""}}, bulk.execute();
{multi: true}
);
printjson (db.runCommand({ getLastError: 1, w: "majority", wtimeout: 5000 } )); printjson (db.runCommand({ getLastError: 1, w: "majority", wtimeout: 5000 } ));
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