【文件属性】:
文件名称:feathers-rename-id:包以使用id代替_id
文件大小:43KB
文件格式:ZIP
更新时间:2021-05-02 06:40:44
JavaScript
羽毛重命名
可以将所有请求的“ _id”更改为“ id”。
配置
const mongooseService = require ( 'feathers-mongoose' ) . Service ;
const Service = require ( 'feathers-rename-id' ) ( mongooseService ) ;
const Post = require ( './post-model' ) ;
module . exports = function ( ) {
const app = this ;
app . use ( '/posts' , new Service ( {
Model : Post ,
newIdName : 'id' // Default value - 'id'
} ) ) ;
} ;
用法
const po
【文件预览】:
feathers-rename-id-master
----.gitignore(554B)
----.babelrc(28B)
----package.json(1KB)
----.npmrc(43B)
----src()
--------index.js(2KB)
----.travis.yml(68B)
----LICENSE(1KB)
----README.md(1KB)
----.npmignore(609B)
----test()
--------index.test.js(2KB)
--------env()
----yarn.lock(136KB)