- 可以从
Model
里获取
const Users = mongoose.model('User', new mongoose.Schema({}), 'users')
const db = Users.db
// 然后就可以使用db了,比如 db.collection('users').find({}).toArray()
Model
里获取const Users = mongoose.model('User', new mongoose.Schema({}), 'users')
const db = Users.db
// 然后就可以使用db了,比如 db.collection('users').find({}).toArray()
{ | |
"v8.x": { | |
"all": [ | |
"assert", | |
"async_hooks", | |
"buffer", | |
"child_process", | |
"cluster", | |
"crypto", | |
"dns", |
/** | |
* source: https://github.com/fex-team/kityminder-core/blob/dev/src/module/text.js#L10-L127 | |
*/ | |
/** | |
* 针对不同系统、不同浏览器、不同字体做居中兼容性处理 | |
* 暂时未增加Linux的处理 | |
*/ | |
var FONT_ADJUST = { | |
'safari': { |
const { exec } = require('shelljs') | |
const path = require('path') | |
const exit = () => { | |
console.log('JavaScript Standard Style errors were detected. Aborting commit.') | |
process.exit(1) | |
} | |
const gitdiff = exec(`git diff --name-only --cached --relative`) | |
if (gitdiff.stderr) { |
URL.createObjectURL(new Blob).split('/')[3]
import CryptoJS from 'crypto-js' | |
function byteArrayToWordArray(ba: Uint8Array) { | |
const wa: number[] = [] | |
for (let i = 0; i < ba.length; i++) { | |
wa[(i / 4) | 0] |= ba[i] << (24 - 8 * i) | |
} | |
return CryptoJS.lib.WordArray.create(wa, ba.length) | |
} |
function n(lit) { | |
const [str] = lit | |
const [start, end] = str.split('..').map((item) => parseInt(item)) | |
return Array.from({ length: end - start + 1 }, (v, k) => k + start) | |
} | |
console.log(n`1..8`) // [1,2,3,4,5,6,7,8] |