Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fridays/feathers-findone
Adds a .findOne() method to services in Feathers.js
https://github.com/fridays/feathers-findone
feathersjs javascript nodejs universal
Last synced: 3 months ago
JSON representation
Adds a .findOne() method to services in Feathers.js
- Host: GitHub
- URL: https://github.com/fridays/feathers-findone
- Owner: fridays
- License: mit
- Created: 2018-01-21T18:22:07.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-08-08T22:32:18.000Z (over 6 years ago)
- Last Synced: 2024-07-18T10:01:32.682Z (4 months ago)
- Topics: feathersjs, javascript, nodejs, universal
- Language: JavaScript
- Size: 51.8 KB
- Stars: 14
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-feathersjs - feathers-findone - Adds a .findOne() method to services in Feathers.js (Plugins / Utilities)
README
# feathers-findone
[![npm version](https://d25lcipzij17d.cloudfront.net/badge.svg?id=js&type=6&v=1.0.2&x2=0)](https://www.npmjs.com/package/feathers-findone)
Adds a `.findOne()` method to services in [Feathers.js v3](https://github.com/feathersjs/feathers)
## Install
```bash
npm install feathers-findone --save
```Configure on server and client:
```javascript
const findOne = require('feathers-findone')app.configure(findOne())
```
Please note that you must configure *findOne* **before** any services are registered.## Use
```javascript
app.service('messages').findOne({/* params */})
```
---
All it does is set `query.$limit = 1` to the params and return the first result of `.find()`