@@ -73,7 +73,7 @@ describe('postgresql connector', function() {
73
73
dataType : 'varchar[]' ,
74
74
} ,
75
75
} ,
76
- } ) ;
76
+ } , { allowExtendedOperators : true } ) ;
77
77
created = new Date ( ) ;
78
78
} ) ;
79
79
@@ -264,15 +264,23 @@ describe('postgresql connector', function() {
264
264
} ) ;
265
265
266
266
it ( 'should support where filter for array type field' , async ( ) => {
267
- Post . dataSource . settings . allowExtendedOperators = true ;
268
- const post = await Post . find ( { where : { and : [
267
+ await Post . create ( {
268
+ title : 'LoopBack Participates in Hacktoberfest' ,
269
+ categories : [ 'LoopBack' , 'Announcements' ] ,
270
+ } ) ;
271
+ await Post . create ( {
272
+ title : 'Growing LoopBack Community' ,
273
+ categories : [ 'LoopBack' , 'Community' ] ,
274
+ } ) ;
275
+
276
+ const found = await Post . find ( { where : { and : [
269
277
{
270
- categories : { 'contains' : [ 'AA ' ] } ,
278
+ categories : { 'contains' : [ 'LoopBack' , 'Community '] } ,
271
279
} ,
272
280
] } } ) ;
273
- should . exist ( post ) ;
274
- post . length . should . equal ( 1 ) ;
281
+ found . map ( p => p . title ) . should . deepEqual ( [ 'Growing LoopBack Community' ] ) ;
275
282
} ) ;
283
+
276
284
it ( 'should support boolean types with false value' , function ( done ) {
277
285
Post . create (
278
286
{ title : 'T2' , content : 'C2' , approved : false , created : created } ,
0 commit comments