dehaze

Simple Queries

You can fetch a single or multiple objects of the same type using a simple object query.

Fetch list of objectslink

Example: Let’s say we want to fetch a list of all pokemons. This is how you would do it:

query {
  pokemons @mongo {
    _id
    name
  }
}
// Select clause describes which fields to retrieve
const selectClause = { _id: 1, name: 1 }

const { status, data } = await db.get("pokemons").select(selectClause).apply()
console.log("Pokemons", data.result)

// To get all the fields in pokemons don't use the select clause:
// const { status, data } = db.get("pokemons").apply()

Have a technical question?

Improve the docs!