Skip to content

Commit b935050

Browse files
committed
use symbol operators in preparation for sequelize v5
1 parent 988e342 commit b935050

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

@@ -123,9 +124,9 @@ var PostsController = {
123124
search: function(term, offset = 0) {
124125
return post.findAll({
125126
where: {
126-
$or: {
127+
[Op.or]: {
127128
body: {
128-
$iLike: `%${term}%`,
129+
[Op.iLike]: `%${term}%`,
129130
},
130131
},
131132
},

0 commit comments

Comments
 (0)