From 8255c353021ba61bbe40e2c71dd27d2ea079abba Mon Sep 17 00:00:00 2001 From: life Date: Sun, 6 Dec 2015 17:30:03 +0800 Subject: [PATCH] =?UTF-8?q?IsDeleted=20=E7=AC=94=E8=AE=B0=E4=B8=8D?= =?UTF-8?q?=E8=A6=81=E5=87=BA=E7=8E=B0;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- node_modules/note.js | 5 +++++ node_modules/notebook.js | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/node_modules/note.js b/node_modules/note.js index a6a1309e..b9c1524d 100644 --- a/node_modules/note.js +++ b/node_modules/note.js @@ -309,6 +309,11 @@ var Note = { var userId = User.getCurActiveUserId(); var query = { UserId: userId, + // 现在还不明确为什么会有IsDeleted的笔记 + $or:[ + {IsDeleted: {$exists: false}}, + {IsDeleted: false} + ], IsTrash: false, LocalIsDelete: false, // 未删除的 }; diff --git a/node_modules/notebook.js b/node_modules/notebook.js index 3663c6fd..2736b641 100644 --- a/node_modules/notebook.js +++ b/node_modules/notebook.js @@ -212,7 +212,15 @@ var Notebook = { // addNote, 删除note, 移动note // 重新统计笔记本的笔记数据 reCountNotebookNumberNotes: function(notebookId) { - db.notes.count({NotebookId: notebookId, IsTrash: false, LocalIsDelete: false}, function(err, count) { + db.notes.count({NotebookId: notebookId, + // 现在还不明确为什么会有IsDeleted的笔记 + $or:[ + {IsDeleted: {$exists: false}}, + {IsDeleted: false} + ], + IsTrash: false, + LocalIsDelete: false + }, function(err, count) { if(err) { log(err); return;