persistent-mongoDB 1.4.4 → 1.4.4.1
raw patch · 2 files changed
+9/−3 lines, 2 files
Files
Database/Persist/MongoDB.hs view
@@ -418,11 +418,17 @@ zipFilter [] _ = [] zipFilter _ [] = [] zipFilter (fd:efields) (pv:pvs) =- if pv == PersistNull then recur else+ if isNull pv then recur else (fieldToLabel fd DB.:= embeddedVal (fieldEmbedded fd) pv):recur where recur = zipFilter efields pvs- -- make sure to removed nulls from an embedded value also++ isNull PersistNull = True+ isNull (PersistMap m) = null m+ isNull (PersistList l) = null l+ isNull _ = False++ -- make sure to removed nulls from embedded entities also embeddedVal :: Maybe (EntityDef a) -> PersistValue -> DB.Value embeddedVal (Just emDef) (PersistMap m) = DB.Doc $ zipFilter (entityFields emDef) $ map snd m
persistent-mongoDB.cabal view
@@ -1,5 +1,5 @@ name: persistent-mongoDB-version: 1.4.4+version: 1.4.4.1 license: MIT license-file: LICENSE author: Greg Weber <greg@gregweber.info>