Here is a statement where Limit()
precedes Sort()
...
var result Candle
dao.c.Find(bson.M{"symbol": "USD"}).Limit(1).Sort("-time").One(&result);
... and here is a statement where Limit()
comes after Sort()
:
var result Candle
dao.c.Find(bson.M{"symbol": "USD"}).Sort("-time").Limit(1).One(&result);
Is there any performance difference between the statements above?