@@ -1926,6 +1926,39 @@ describe('Parse.Query testing', () => {
1926
1926
} )
1927
1927
} ) ;
1928
1928
1929
+ it ( "multiple dontSelect query" , function ( done ) {
1930
+ var RestaurantObject = Parse . Object . extend ( "Restaurant" ) ;
1931
+ var PersonObject = Parse . Object . extend ( "Person" ) ;
1932
+ var objects = [
1933
+ new RestaurantObject ( { ratings : 7 , location : "Djibouti2" } ) ,
1934
+ new RestaurantObject ( { ratings : 5 , location : "Djibouti" } ) ,
1935
+ new RestaurantObject ( { ratings : 3 , location : "Ouagadougou" } ) ,
1936
+ new PersonObject ( { name : "Bob2" , hometown : "Djibouti2" } ) ,
1937
+ new PersonObject ( { name : "Bob" , hometown : "Djibouti" } ) ,
1938
+ new PersonObject ( { name : "Tom" , hometown : "Ouagadougou" } ) ,
1939
+ ] ;
1940
+
1941
+ Parse . Object . saveAll ( objects , function ( ) {
1942
+ var query = new Parse . Query ( RestaurantObject ) ;
1943
+ query . greaterThan ( "ratings" , 6 ) ;
1944
+ var query2 = new Parse . Query ( RestaurantObject ) ;
1945
+ query2 . lessThan ( "ratings" , 4 ) ;
1946
+ var subQuery = new Parse . Query ( PersonObject ) ;
1947
+ subQuery . matchesKeyInQuery ( "hometown" , "location" , query ) ;
1948
+ var subQuery2 = new Parse . Query ( PersonObject ) ;
1949
+ subQuery2 . matchesKeyInQuery ( "hometown" , "location" , query2 ) ;
1950
+ var mainQuery = new Parse . Query ( PersonObject ) ;
1951
+ mainQuery . doesNotMatchKeyInQuery ( "objectId" , "objectId" , Parse . Query . or ( subQuery , subQuery2 ) ) ;
1952
+ mainQuery . find ( expectSuccess ( {
1953
+ success : function ( results ) {
1954
+ equal ( results . length , 1 ) ;
1955
+ equal ( results [ 0 ] . get ( 'name' ) , 'Bob' ) ;
1956
+ done ( ) ;
1957
+ }
1958
+ } ) ) ;
1959
+ } ) ;
1960
+ } ) ;
1961
+
1929
1962
it ( "object with length" , function ( done ) {
1930
1963
var TestObject = Parse . Object . extend ( "TestObject" ) ;
1931
1964
var obj = new TestObject ( ) ;
0 commit comments