-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
equalTo and notEqualTo don't work on relations #1349
Comments
@lolobosse that test case is awesome! I guess that makes you understand how complex it is for us to reproduce bugs and make sure we don't hit regression! :) In any case we'll look at it shortly! just a quick question, does the equalTo works? |
@flovilmart yes, I can remember that it worked but this is a good idea, I'll update my test case |
ok thanks! |
Soooo, I made a much deeper test and tested, I hope almost every possibility except combinations (combinations should work but I didn't test that): here For the lazy ones, here is the interesting part 😄 : then(function(){
var query = new Parse.Query(Cake);
// User2 likes nothing so we should receive 0
query.equalTo("liker", user2);
return query.find().then(function(results){
equal(results.length, 0);
});
}).then(function(){
var query = new Parse.Query(Cake);
// User1 likes two of three cakes
query.equalTo("liker", user1);
return query.find().then(function(results){
// This test fails on 2.2.4
// It should return 2 -> cake 1 and cake 2
equal(results.length, 2);
});
}).then(function(){
var query = new Parse.Query(Cake);
// We want to know which cake the user1 is not appreciating -> cake3
query.notEqualTo("liker", user1);
return query.find().then(function(results){
// This test fails on 2.2.4
// Should return 1 -> the cake 3
equal(results.length, 1);
});
}).then(function(){
var query = new Parse.Query(Cake);
// User2 is a hater of everything so we should receive 0
query.notEqualTo("hater", user2);
return query.find().then(function(results){
// This test fails on 2.2.4
equal(results.length, 0);
}); |
I skimmed through the code and it looks like we don't support it as it is. |
Cool! Yes, it was working on Parse.com; I know that I'm playing with the limits of the system and if you decide not to implement it, I have the possibility to do something else BUT I think it is a good target to have the exact same characteristics as Parse.com! And if you do not do it, please document it properly so that it is clear from the beginning that this system is a bit more limited than Parse.com |
We aim to feature parity, and you have written the test case, 90% of the work is done :) |
So I checked, equalTo was actually working, some of your tests had some faulty design. Just opened the PR, waiting for the merge. |
Good afternoon,
I tried to use the code I wrote for Parse.com (some CloudCode stuff) on parse-server and it seems that there is a bug with the
equalTo
andnotEqualTo
methods.Some issues have been fixed like #801 but it seems that the bug still exists.
I wrote a test case to illustrate the bug (got a lot of trouble doing it and I could have written it in a much better way but it shows the bug! 😄 💪 )
Basically the use case is the following: you have two lists -> on one side you have the guys who love a cake ( 🍰 😋 !) and on the other hand, you have the guy who hate this very same cake (😠). In particular in my test case, the
user2
likes no cake and is a hater of possible cakes.So if I ask for: Give me all the cakes where the user2 is NOT a hater it should return null. It actually returns 3...
Translated into code:
returns 3 instead of 0.
Did I miss something?
Environment Setup
VERBOSE=1
Parse-Server 2.2.4
The text was updated successfully, but these errors were encountered: