Skip to content
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

How to get the most recent record of a given class from parse? #127

Open
dlio opened this issue May 30, 2014 · 2 comments
Open

How to get the most recent record of a given class from parse? #127

dlio opened this issue May 30, 2014 · 2 comments

Comments

@dlio
Copy link

dlio commented May 30, 2014

Is there an easy lookup to simply retrieve the one most recently created record for a given class? I have been trying various workarounds with the example methods but I cannot seem to figure out how. I could use the HTTP API to do so but I'm guessing that this is a fairly common use case for this gem. Any help would be much appreciated; cheers and thanks for this great gem.

@dlio
Copy link
Author

dlio commented May 30, 2014

Is there is a way to pass through any of these constraints?
https://www.parse.com/docs/rest#queries

@xavdid
Copy link

xavdid commented Mar 6, 2015

@dlio Sorry for the slow reply!

So I'm not sure if this was the case when you opened this issue, but this is definitely possible now. See query constraints.

an example:

new_user = Parse::Query.new("_User").tap do |q| 
  q.order_by = 'createdAt' 
  q.order = :descending
end.get.first

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants