Skip to content

Commit 745287f

Browse files
committed
use symbol operators in preparation for sequelize v5
1 parent b3ba1ca commit 745287f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

controllers/PostsController.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
var post = rootRequire('models/Post');
22
var user = rootRequire('models/User');
33
var Sequelize = require('sequelize');
4+
const Op = Sequelize.Op;
45

56
var models = {post: post, user: user};
67

@@ -133,9 +134,9 @@ var PostsController = {
133134
search: function(term, offset = 0) {
134135
return post.findAll({
135136
where: {
136-
$or: {
137+
[Op.or]: {
137138
body: {
138-
$iLike: `%${term}%`
139+
[Op.iLike]: `%${term}%`
139140
}
140141
}
141142
},

0 commit comments

Comments
 (0)