Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cs_comments_service
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
cs_comments_service
Commits
634612a5
Commit
634612a5
authored
Aug 19, 2015
by
Feanil Patel
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #136 from edx/feanil/update_context_migration
Use bulk operation instead.
parents
1dff2db4
05758888
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
5 deletions
+3
-5
scripts/db/migrate-008-context.js
+3
-5
No files found.
scripts/db/migrate-008-context.js
View file @
634612a5
...
@@ -3,9 +3,7 @@ db.contents.ensureIndex({ _type: 1, course_id: 1, context: 1, pinned: -1, create
...
@@ -3,9 +3,7 @@ db.contents.ensureIndex({ _type: 1, course_id: 1, context: 1, pinned: -1, create
db
.
contents
.
ensureIndex
({
_type
:
1
,
commentable_id
:
1
,
context
:
1
,
pinned
:
-
1
,
created_at
:
-
1
},
{
background
:
true
})
db
.
contents
.
ensureIndex
({
_type
:
1
,
commentable_id
:
1
,
context
:
1
,
pinned
:
-
1
,
created_at
:
-
1
},
{
background
:
true
})
print
(
"Adding context to all comment threads where it does not yet exist
\
n"
);
print
(
"Adding context to all comment threads where it does not yet exist
\
n"
);
db
.
contents
.
update
(
var
bulk
=
db
.
contents
.
initializeUnorderedBulkOp
();
{
_type
:
"CommentThread"
,
context
:
{
$exists
:
false
}},
bulk
.
find
(
{
_type
:
"CommentThread"
,
context
:
{
$exists
:
false
}}
).
update
(
{
$set
:
{
context
:
"course"
}}
);
{
$set
:
{
context
:
"course"
}},
bulk
.
execute
();
{
multi
:
true
}
);
printjson
(
db
.
runCommand
({
getLastError
:
1
,
w
:
"majority"
,
wtimeout
:
5000
}
));
printjson
(
db
.
runCommand
({
getLastError
:
1
,
w
:
"majority"
,
wtimeout
:
5000
}
));
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment