2015-07-13 227 views
0

我在mongo db中創建一個聚合。我有這樣的錯誤

$纂的表達不應該從變量一邊返回任何& & KEEP,$$下潛和$$裁剪,但返回{如果:真正}

回答

0

聽起來您$redact沒有$cond statment內它的參數:

db.collection.aggregate([ 
    { "$redact": { 
     "$cond": { 
      "if": <logical condition> 
      "then": < something like $$KEEP or $$PRUNE or $$DESCEND >, 
      "else": < something like $$KEEP or $$PRUNE (etc) depending on which is false > 
     } 
    }} 
]) 

這一切都覆蓋在手冊中頁面鏈接。