The distributed serverless database combining the flexibility of NoSQL with the relational querying capabilities of SQL systems.
Emit new event each time you add or remove a document from a specific collection, with the details of the document.
module.exports = defineComponent({
props: {
faunadb: {
type: "app",
app: "faunadb",
}
},
async run({steps, $}) {
const faunadb = require('faunadb')
const q = faunadb.query
const client = new faunadb.Client({ secret: this.faunadb.$auth.secret })
// Lists collections in the database tied to your secret key
const collectionsPaginator = await client.paginate(q.Collections())
this.collections = []
await collectionsPaginator.each(page => {
for (const collection of page) {
this.collections.push(collection.id)
}
})
},
})
export default defineComponent({
async run({ steps, $ }) {
const text = ' Hello world! ';
return text.trim()
},
})