Gathering detailed insights and metrics for mongoose-rest-actions
Gathering detailed insights and metrics for mongoose-rest-actions
Gathering detailed insights and metrics for mongoose-rest-actions
Gathering detailed insights and metrics for mongoose-rest-actions
mongoose-paginate-v2
A custom pagination library for Mongoose with customizable labels.
mongoose
Mongoose MongoDB ODM
@octokit/plugin-rest-endpoint-methods
Octokit plugin adding one method for all of api.github.com REST API endpoints
mongoose-aggregate-paginate-v2
A cursor based custom aggregate pagination library for Mongoose with customizable labels.
npm install mongoose-rest-actions
48
Supply Chain
83.6
Quality
74.7
Maintenance
50
Vulnerability
98.1
License
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
11 Stars
305 Commits
2 Forks
2 Watching
16 Branches
3 Contributors
Updated on 21 Mar 2023
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
250%
7
Compared to previous day
Last week
-74.1%
42
Compared to previous week
Last month
6%
444
Compared to previous month
Last year
-56.6%
5,062
Compared to previous year
13
1
mongoose rest actions on top of expressjs
Note: You may install express-mquery to have http query parameter parsed to valid mongoose query criteria
1$ npm install --save mongoose mongoose-rest-actions express-mquery
1const express = require('express'); 2const mquery = require('express-mquery'); 3const mongoose = require('mongoose'); 4const actions = require('mongoose-rest-actions'); 5mongoose.plugin(actions); 6 7//... register & load mongoose models 8 9mongoose.connect('<url>'); 10 11 12const app = express(); 13app.use(mquery({limit: 10, maxLimit: 50})); 14const User = mongoose.model('User'); 15 16app.get('/users', function(request, response, next) { 17 18 const options = request.mquery; 19 20 User 21 .get(options, function(error, results) { 22 ...handle error or reply 23 }); 24 25}); 26 27 28app.post('/users', function(request, response, next) { 29 30 const body = request.body; 31 32 User 33 .post(body, function(error, user) { 34 ...handle error or reply 35 }); 36 37}); 38 39 40app.get('/users/:id', function(request, response, next) { 41 42 const _id = request.params.id; 43 44 User 45 .getById(_id, function(error, user) { 46 ...handle error or reply 47 }); 48 49}); 50 51 52app.put('/users/:id', function(request, response, next) { 53 54 let updates = request.body; 55 const _id = request.params.id; 56 57 User 58 .put(_id, updates, function(error, user) { 59 ...handle error or reply 60 }); 61 62}); 63 64 65app.patch('/users/:id', function(request, response, next) { 66 67 let updates = request.body; 68 const _id = request.params.id; 69 70 User 71 .patch(_id, updates, function(error, user) { 72 ...handle error or reply 73 }); 74 75}); 76 77 78app.delete('/users/:id', function(request, response, next) { 79 80 const _id = request.params.id; 81 82 User 83 .del(_id, function(error, user) { 84 ...handle error or reply 85 }); 86 87}); 88 89... 90
Clone this repository
Install all development dependencies
1$ npm install
1$ npm test
It will be nice, if you open an issue first so that we can know what is going on, then, fork this repo and push in your ideas. Do not forget to add a bit of test(s) of what value you adding.
The MIT License (MIT)
Copyright (c) 2018 - present lykmapipo & Contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/24 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
38 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More