Unable to query rows with array keys which equals empty array []
Issue Description
Couldn't find a way to query rows with array keys equal to empty array. For example: I have class 'Shelf' with key 'books' type of Array I have 2 rows. First row has books = [ { Pointer }, { Pointer } ]. Second row has books = []
How do i query second row?
Hi! @hybeats . My workaround to make these types of queries is the following:
const pipeline = [{ match: { books: { $eq: [] } } }];
const shelfs = await query.aggregate(pipeline);
return shelfs;
@davimacedo Maybe it will be good to query with equalTo: [] method.
@dplewis Is this an issue with Parse JS SDK?
@hybeats Sorry for the late reply. Can you provide sample code or write up a failing test?
@dplewis I tried this code, without a successful response.
const query = new Parse.Query('Shelf');
query.equalsTo('books', []);
const shelfs = await query.find();
return shelfs;
Could you please help me anyone How to check array empty and array contain some value and undefined ? in parse android ArrayList<String> list = new ArrayList<String>(); list.add("CP"); query.whereDoesNotExist("businessPlatform"); query.whereContainedIn("businessPlatform", list); This is not working How should i process this type of condition AND Operation is available in parse query ?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Any news about this? The aggregate workaround doesn't work for me because I put this query in an OR query.
@gcostaapps If you experience this issue with the latest version of Parse Server could you please open a new issue so we can investigate this?
Still happens, version 5.3.3 @santiagosemhan example is accurate, for array field with [] value
Could you open a PR against alpha with a failing test that demonstrates the issue? That would help us to address it.
Thanks for opening this issue!
- ❌ Please edit your post and use the provided template when creating a new issue. This helps everyone to understand your post better and asks for essential information to quicker review the issue.
Is it fixed with the latest versions?
We don't know. If someone could open a PR with a failing test, that would help us.