You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i got less than 5 objects nevertheless the user has more than 5 posts.
Steps to reproduce
Creates 6 posts, let say post 1, post 2, ..., post 6. Post[i] is created before Post[i+1].
Delete the last created post (post 6).
Then run the provided query with limit 5.
Actual Outcome
The query returns post 5, post 4, post 3 and post 2 (total of 4 posts).
Expected Outcome
My expectation is that the query will omit the deleted object and return the first 5 available objects - post 5 up to post 1.
This happens because the join table representing the relation keeps the id of the deleted object. The limit operator gives 5 object ids including the id of the deleted object. I consider this a bug.
Server
Parse Server version: 4.10.4
Operating system: macOS
Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): Local/Heroku
Database
System (MongoDB or Postgres): MongoDB
Database version: 8.0.4
Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): MongoDB Atlas
One workaround i can think of is: Post.query().where(matchesKeyInQuery(key: "objectId", queryKey: "objectId", query: user.relation("posts", className: Post.className) .query(Post()))) .limit(5) .order(.descending("createdAt"))
Issue Description
I have two parse classes User and Post. The user class has relation named posts containing Post objects. When i do
the following query
user.relation("posts", className: Post.className) .query(Post()) .limit(5) .order(.descending("createdAt"))
i got less than 5 objects nevertheless the user has more than 5 posts.
Steps to reproduce
Actual Outcome
The query returns post 5, post 4, post 3 and post 2 (total of 4 posts).
Expected Outcome
My expectation is that the query will omit the deleted object and return the first 5 available objects - post 5 up to post 1.
This happens because the join table representing the relation keeps the id of the deleted object. The limit operator gives 5 object ids including the id of the deleted object. I consider this a bug.
Server
4.10.4
macOS
Local/Heroku
Database
MongoDB
8.0.4
MongoDB Atlas
Client
iOS
3.1.0
The text was updated successfully, but these errors were encountered: