remove all bad study chapter nodes

pull/5150/head
Thibault Duplessis 2019-05-28 13:09:50 +02:00
parent 7e00b4b35f
commit e6845ffe78
1 changed files with 4 additions and 3 deletions

View File

@ -1,4 +1,4 @@
var studyId = '0Obg93mv';
// var studyId = '0Obg93mv';
function dig(chapId, node, path) {
for (var i in node.n) {
@ -16,7 +16,8 @@ function dig(chapId, node, path) {
}
}
db.study_chapter.find({studyId: studyId}).forEach(chap => {
print(`${studyId}/${chap._id}`);
// db.study_chapter.find({studyId: studyId}).forEach(chap => {
db.study_chapter.find({}).forEach(chap => {
print(`${chap.studyId}/${chap._id}`);
dig(chap._id, chap.root, 'root');
});