Last active
January 29, 2019 16:17
-
-
Save JunKikuchi/138708d16b0c95a4ce88c64022064d2f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Control.Lens | |
import Data.ProtoLens.Runtime.Data.ProtoLens | |
import Proto.Google.Firestore.V1beta1.Document as Doc | |
import Proto.Google.Firestore.V1beta1.Document_Fields as Doc | |
import Data.Text as T | |
import Data.Map | |
value = defMessage & maybe'valueType .~ (_Just # _Value'BooleanValue # Prelude.True) :: Doc.Value | |
-- {boolean_value: true} | |
doc = defMessage & Doc.fields .~ (fromList [(T.pack "foo", value)]) :: Doc.Document | |
-- {fields { key: "foo" value { boolean_value: true } }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment