The title asks it all.
I have found an example that looked something like this:
db.find(fields = {"-id"}).sort("-id", -1).limit(X)
but that doesn’t seem safe because that is assuming the ids will actually be in order.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’ll add the ID to the $item array. Also note you can use an object instead of an array if it’s your preference.