fridays / feathers-findone

Adds a .findOne() method to services in Feathers.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

feathers-findone

npm version

Adds a .findOne() method to services in Feathers.js v3

Install

npm install feathers-findone --save

Configure on server and client:

const findOne = require('feathers-findone')

app.configure(findOne())

Please note that you must configure findOne before any services are registered.

Use

app.service('messages').findOne({/* params */})

All it does is set query.$limit = 1 to the params and return the first result of .find()

About

Adds a .findOne() method to services in Feathers.js

License:MIT License


Languages

Language:JavaScript 100.0%