1.0.12 • Published 8 months ago

w-serv-orm v1.0.12

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

w-serv-orm

An operator for orm in server.

language npm version license 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.11

9 months ago

1.0.12

8 months ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago