Adds sort to mongo query block.