I have just shifted from the old Mongo extension to the newest PHP driver (mongodb). I'm also using the PHP library provided for mongodb.
Previously, I could simply do ->sort()
on a cursor instance, but that doesn't seem to be the case any more since I get this error:
Fatal error: Uncaught Error: Call to undefined method MongoDBDriverCursor::sort()
What is the alternative to sorting/limiting/skipping now?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…