Use a GET handler to read documents.
async function handler(state) {
return state.plugins.mongodb
.collection('users')
.find({ active: true })
.limit(20)
.toArray()
}
Read one document with findOne({ email: 'jack@example.com' }). It returns null when no document matches. Set up the plugin with Connect.
Next: Create →