Sequelize降序排序空值在后面
order: [
['last_access_timed_at', 'DESC NULLS LAST'],
]
Sequelize升序排序空值在前面
order: [
['last_access_timed_at', 'ASC NULLS FIRST'],
]
同理DESC,ASC,FIRST,LAST自由组合。
Sequelize降序排序空值在后面
order: [
['last_access_timed_at', 'DESC NULLS LAST'],
]
Sequelize升序排序空值在前面
order: [
['last_access_timed_at', 'ASC NULLS FIRST'],
]
同理DESC,ASC,FIRST,LAST自由组合。
查询条件限制
const Op = Sequelize.Op
[Op.and]: {a: 5} // 且 (a = 5)
[Op.or]: [{a: 5}, {a: 6}] // (a = 5 或 a = 6)
[Op.gt]: 6, // id > 6
[Op.gte]: 6, // id >= 6
[Op.lt]: 10, // id < 10
[Op.lte]: 10, // id <= 10
[Op.ne]: 20, // id != 20
[Op.eq]: 3, // = 3
[Op.not]: true, // 不是 TRUE
[Op.between]: [6, 10], // 在 6 和 10 之间
[Op.notBetween]: [11, 15], // 不在 11 和 15 之间
[Op.in]: [1, 2], // 在 [1, 2] 之中
[Op.notIn]: [1, 2], // 不在 [1, 2] 之中
[Op.like]: '%hat', // 包含 '%hat'
[Op.notLike]: '%hat' // 不包含 '%hat'
[Op.iLike]: '%hat' // 包含 '%hat' (不区分大小写) (仅限 PG)
[Op.notILike]: '%hat' // 不包含 '%hat' (仅限 PG)
[Op.regexp]: '^[h|a|t]' // 匹配正则表达式/~ '^[h|a|t]' (仅限 MySQL/PG)
[Op.notRegexp]: '^[h|a|t]' // 不匹配正则表达式/!~ '^[h|a|t]' (仅限 MySQL/PG)
[Op.iRegexp]: '^[h|a|t]' // ~* '^[h|a|t]' (仅限 PG)
[Op.notIRegexp]: '^[h|a|t]' // !~* '^[h|a|t]' (仅限 PG)
[Op.like]: { [Op.any]: ['cat', 'hat']} // 包含任何数组['cat', 'hat'] - 同样适用于 iLike 和 notLike
[Op.overlap]: [1, 2] // && [1, 2] (PG数组重叠运算符)
[Op.contains]: [1, 2] // @> [1, 2] (PG数组包含运算符)
[Op.contained]: [1, 2] // <@ [1, 2] (PG数组包含于运算符)
[Op.any]: [2,3] // 任何数组[2, 3]::INTEGER (仅限PG)
[Op.col]: 'user.organization_id' // = 'user'.'organization_id', 使用数据库语言特定的列标识符, 本例使用 PG
pm2 start App.js
pm2 stop App.js
pm2 delete App
pm2 list
const { mysql } = require('../qcloud')
module.exports = async (ctx, next) => {
return mysql.select()
.from('cSessionInfo')
.then(function (response) {
ctx.state.data = response
})
}
In file included from ../lib/kerberos.cc:1:0: ../lib/kerberos.h:5:27: fatal error: gssapi/gssapi.h: 没有那个文件或目录 compilation terminated. kerberos.target.mk:88: recipe for target 'Release/obj.target/kerberos/lib/kerberos.o' failed make: *** [Release/obj.target/kerberos/lib/kerberos.o] Error 1 make: Leaving directory '/home/liuman/paipaijian/node_modules/connect-mongo/node_modules/mongodb/node_modules/kerberos/build'
安装libkrb
sudo apt-get install libkrb5-dev
doctype html
html
head
style.
div{
float:left
}
h2
script.
var a = 1;
body
p.
hello jade
hello jade
- var user = { description: '我喜欢猫' }
//- if 判断
#user.user
if user.description
h2 描述
p.description= user.description
else
h1 描述
p.description 用户无描述
//- for 循环
- var array = [1,2,3]
ul
- for (var i = 0; i < array.length; ++i) {
li hello #{array[i]}
- }
//- each
ul
each val, index in ['西瓜', '苹果', '梨子']
li= index + ': ' + val
- var friends = 10
//- Case
case friends
when 0
p you have no friends
when 1
p you have a friend
default
p you have #{friends} friends
//- 申明可重用的块
mixin list
ul
li foo
li bar
li baz
//- 调用
+list()
+list()
mixin pets (pets)
ul#pets.pets
- each val, key in pets
li #{ val + ':' + key }
//- 调用
+pets(['cat', 'dog', 'pig'])
mixin article(title)
.article
.article-wrapper
h1= title
//- block 为 jade 关键字代表外部传入的块
if block
block
else
p 该文章没有内容
+article('Hello world')
+article('Hello Jade')
p 这里是外部传入的块
p 再写两句
mixin link(href, name)
a(class!=attributes.class, href=href)= name
+link('/foo', 'foo')(class="btn")