Returns the encoder for a List of a Json type
Returns the decoder for a List of a Json type
import Json.Decode as D
"\"Hello World\"" |> (string |> decode |> D.decodeString) --> Ok "Hello World"import Json.Decode as D
import Dict exposing (Dict)
"{\"value\":42}"
|> (int |> dict |> decode |> D.decodeString) --> Ok (Dict.singleton "value" 42)import Json.Decode as D
type alias Obj =
{ value : Int
, name : String
}
"{\"value\":42,\"name\":\"Elm\"}"
|> ( object Obj
|> with "value" int .value
|> with "name" string .name
|> toJson
|> decode
|> D.decodeString
)
--> Ok {value=42,name="Elm"}First gets the value, then either inserts a new value or does nothing
Use delete if you want to delete an element.
There is a max limit of 100kb that can be inserted at once. Therefore never try to update a full list of object, rather send an seperate update/delete file for every entry of the list.
Gets an Element
Returns Nothing if the element does not exist.
Inserts a new Element.
Do not use this function to update fields, use update instead.
There is a max limit of 100kb that can be inserted at once. Therefore never try to update a full list of object, rather send an seperate update/delete file for every entry of the list.
Deletes an Element.
Will be successfull even if the content is empty.
The Json type combines both the Json Decoder and Encoder.