# `ElementorexCms.Ecto.Document`
[🔗](https://github.com/rocket4ce/elementorex_cms/blob/v0.1.0/lib/elementorex_cms/ecto/document.ex#L2)

Ecto type for documents, stored as a map (`jsonb` in PostgreSQL).

    schema "pages" do
      field :body, ElementorexCms.Ecto.Document, default: ElementorexCms.Document.new()
    end

Casting accepts a map or a JSON string and normalizes it with the default
registry (see `ElementorexCms.Document.normalize/2`), so whatever reaches the
database is a valid, sanitized document.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
