1.0.10 • Published 26 days ago

w-serv-orm v1.0.10

Weekly downloads
-
License
MIT
Repository
github
Last release
26 days ago

w-serv-orm

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: w-serv-orm is mainly dependent on lodash-es and wsemi.

npm i w-serv-orm

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 // }

1.0.10

26 days ago

1.0.9

1 month ago

1.0.8

1 month ago

1.0.7

11 months ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago