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
Hi, I've just discovered a distinct query and I tried to use it to get unique comment authors from a list of comments. The query restrictions work well, but it seems that it is not possible to get like "5 newest authors", because the ordering and limiting do not work.
I think this is most probably not implemented, it would be awesome if somebody could do it :)
I have no idea how complicated this could be. What do you think @dplewis ? :) 🥇
Of course, I can use just a usual query, but the distinct query seems much more efficient, I like it!
var subcommentsQuery = new Parse.Query("Comment");
//those work as expected
subcommentsQuery.equalTo("pComment", savedObject);
subcommentsQuery.notContainedIn("author", [editingUser, savedObject.get("author")]);
if (savedObject.get("forAll"))
subcommentsQuery.greaterThan("createdAt", addHours(new Date(), -36));
//those does not work at all (when using the distinct query)
subcommentsQuery.ascending("createdAt");
subcommentsQuery.limit(1);
return subcommentsQuery.distinct("author").then( ...
The text was updated successfully, but these errors were encountered:
@rihadavid As far as I can tell distinct for mongo doesn't support limit and sort options. It also returns a promise instead of a cursor. You can use the regular aggregate stages group.
Hi, I've just discovered a distinct query and I tried to use it to get unique comment authors from a list of comments. The query restrictions work well, but it seems that it is not possible to get like "5 newest authors", because the ordering and limiting do not work.
I think this is most probably not implemented, it would be awesome if somebody could do it :)
I have no idea how complicated this could be. What do you think @dplewis ? :) 🥇
Of course, I can use just a usual query, but the distinct query seems much more efficient, I like it!
The text was updated successfully, but these errors were encountered: