新手问题:
我之前创建了一个mongo集合。最近插入了一些文档但结构略有变化 - 只添加了新字段。现在,我想返回并使用默认值的新字段更新旧文档。怎么样?
示例:
data Settings = Settings
{ sVerbose :: Bool
, sFileTitle :: Bool
, sSource :: FilePath
, sDestination :: FilePath
}
settingsP :: Parser Settings
settingsP =
Settings <$> switch "verbose" 'v' "Be more verbose"
<*> switch "filetitle" 'f' "..."
<*> argPath "src" "Source directory"
<*> argPath "dest" "Destination directory"
description :: Description
description = "Description of your program"
main = do
(Settings verbose filetitle source dest) <- options description settingsP
...
如何使用&#34; z&#34;更新前两个文档?零值?
答案 0 :(得分:3)