-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Support deeply nested pointers in 'containedIn' queries #7414
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
Comments
Thanks for reporting. I think that makes sense. Are you suggesting that when the Or should stating the What would currently happen if a custom field is used, e.g. |
What I suggest is using To sum up, the actual state is : The 2 options without objectId are a more natural way for Parse users to query. Many of my developers have faced this issue. |
I think you are right. I agree that it should be possible to do I am less sure about whether we should allow |
That would be a breaking change for sure, and I don't think being able to use any Pointer subfield is bad. |
We are now following a phased deprecation policy to avoid sudden breaking changes. So developers would have time to adapt to a change. We need to maintaining the code base and that means stripping features that are duplicates or provide little value, even if they are breaking changes. That's why I'm wondering what benefit |
Maybe I just have the id. And it's not only about objectId. Maybe one time, I'd like to get all the Parse.Object documents with an array containing at least a pointer of class Child. As I said, I love the way parse-server doesn't get in the way. For example, you can create a Parse.Function or use a direct express route (to download pdf file, for instance). That's what make my clients adopt parse-server. You're not blocked. I'm curious to know the proportion of parse-server projects that have the equivalent of those few line :
Btw, we should get a public API for this 😋. Parse can't (and shouldn't) do everything, it already does so much. |
Would you want to open a PR to add the |
I can try... |
Great, I assume the |
I did some tests, and I think I understand the problem now. I found the cause. It's actually a bug in MongoTransform's transformConstraint. This is what it outputs now. with equalTo (good result) : mongoWhere: { with containedIn (bad result) : mongoWhere: { I'm preparing the PR. |
The PR is #7426 |
@mtrezza , tell me if something is missing from the PR |
Even i debugged, found the same issue |
EDITED: SEEMS NESTED OBJECTS ARE STORED AS JSON check this comment #8209 (comment) |
🎉 This change has been released in version 8.2.1-alpha.1 |
New Issue Checklist
Issue Description
Querying using "containedIn" in deep nested objects using pointers doesn't seems to work.
Steps to reproduce
See example below.
Actual Outcome
The queries return empty arrays.
Expected Outcome
We expected an array of Parse.Object .
Failing Test Case / Pull Request
To reproduce the issue, I added this at the end of ParseQuery.spec.js
This test passes if I replace the line :
.containedIn('children.child', [child1])
by
.containedIn('children.child.objectId', [child1.id])
Environment
parse-server 4.5.0
Server
Database
Client
Logs
The text was updated successfully, but these errors were encountered: