Release v0.4.0
This release contains additions to the Query DSL.
Changes
Overview
Added by/2
by/2
allows you to add collection filters as described in the API Docs to your queries against Entries
and Assets
.
Example
import Contentful.Query
alias Contentful.Delivery.Entries
{:ok, entries, total: 1}
= Entries
|> content_type("dogs")
|> by(name: "Hasso", breed: "dalmatian")
|> fetch_all
The filters supported here are [:in, :nin, :ne, :lte, :gte, :lt, :gt, :match, :exist]
:
import Contentful.Query
alias Contentful.Delivery.Entries
{:ok, entries, total: 100}
= Entries
|> content_type("dogs")
|> by(name: [ne: "Hasso"], breed: "dalmatian")
|> fetch_all
You can use any field
to query, as well as the id
of an entry or asset.
Added search_full_text/2
Allows the addition of a query
to perform a search over all fields of an entry.
Example
{:ok, nyan_cats, total: 616}
= Entries
|> search_full_text("Nyancat")
|> fetch_all