@swenkerorg/quam-voluptate

1.1.25 • Public • Published

@swenkerorg/quam-voluptate

An operator for orm in server.

language npm version license gzip file size npm download npm download jsdelivr download

Documentation

To view documentation or get support, visit docs.

Installation

Using npm(ES6 module):

Note: @swenkerorg/quam-voluptate is mainly dependent on lodash-es and wsemi.

npm i @swenkerorg/quam-voluptate

Example for server:

Link: [dev source code]

import WOrm from 'w-orm-mongodb/src/WOrmMongodb.mjs' //自行選擇引用ORM
import ds from './schema/index.mjs' //先行建置schema
import WServOrm from './src/WServOrm.mjs'


//st
let st = {
    dbUsername: 'username',
    dbPassword: 'password',
    dbName: 'wservorm',
    dbIP: 'localhost',
    dbPort: 27017,
}

//url, db
let url = `mongodb://${st.dbUsername}:${st.dbPassword}@${st.dbIP}:${st.dbPort}`
let db = st.dbName

//WServOrm
let opt = {
    getUserById: null,
    bCheckUser: false,
    bExcludeWhenNotAdmin: false,
}
let r = WServOrm(ds, WOrm, url, db, opt)
console.log(r) //回傳server用orm相關函數
// => {
//   backup: [AsyncFunction: backup],
//   recover: [AsyncFunction: recover],
//   woItems: {
//     tests: EventEmitter {
//       _events: [Object: null prototype] {},
//       _eventsCount: 0,
//       _maxListeners: undefined,
//       select: [AsyncFunction: select],
//       insert: [AsyncFunction: insert],
//       save: [AsyncFunction: save],
//       del: [AsyncFunction: del],
//       delAll: [AsyncFunction: delAll],
//       selectGfs: [AsyncFunction: selectGfs],
//       insertGfs: [AsyncFunction: insertGfs],
//       delGfs: [AsyncFunction: delGfs],
//       delAllGfs: [AsyncFunction: delAllGfs],
//       [Symbol(kCapture)]: false
//     }
//   },
//   addFunCheck: [Function: addFunCheck],
//   addFunPreProcessing: [Function: addFunPreProcessing],
//   addFunPostProcessing: [Function: addFunPostProcessing],
//   procOrm: [AsyncFunction: procOrm]
// }

Readme

Keywords

Package Sidebar

Install

npm i @swenkerorg/quam-voluptate

Weekly Downloads

299

Version

1.1.25

License

MIT

Unpacked Size

61.8 kB

Total Files

131

Last publish

Collaborators

  • swenkertreanpm