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_
db.contents.dropIndex({ _type: 1, commentable_id: 1, context: 1, pinned: -1, created_at: -1 })
print ("Removing context from all comment threads\n");
db.contents.update(
{_type: "CommentThread"},
{$unset: {context: ""}},
{multi: true}
);
var bulk = db.contents.initializeUnorderedBulkOp();
bulk.find( {_type: "CommentThread", context: {$exists: true}} ).update( {$unset: {context: ""}} );
bulk.execute();
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