https://github.com/langhuihui/mongo-search
Utils for mongodb search and display
https://github.com/langhuihui/mongo-search
Last synced: 15 days ago
JSON representation
Utils for mongodb search and display
- Host: GitHub
- URL: https://github.com/langhuihui/mongo-search
- Owner: langhuihui
- License: mit
- Created: 2019-01-16T09:34:47.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-01-18T03:33:56.000Z (over 6 years ago)
- Last Synced: 2025-03-18T07:22:48.469Z (about 1 month ago)
- Language: JavaScript
- Size: 85 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mongo-search
Utils for mongodb search and display# install
npm i mongo-search# usage
## vue component
```js
import vue from 'mongo-search/vue'
import Vue from 'vue'
Vue.use(vue)
```
```html```
###props
```js
{
src: { type: String, required: true },
params: { type: Object },
range: { type: String, default: '' },
pageSize: { type: Number },
value: {
type: Array,
default: () => []
},
desc: {
type: Boolean,
default: true
},
search: {
type: String
}
}
```
###methods
getLast、getNext## koa middleware
```js
const { MongoClient } = require('mongodb');
const searchM = require('mongo-search')
MongoClient.connect("mongodb://127.0.0.1:27017"), { useNewUrlParser: true }).then(x => {
let db = x.db('test')
router.get('/user',async ctx=>ctx.body=await searchM(db.collection('user')))
}
```