diff --git a/lib/cube/genericGetter.js b/lib/cube/genericGetter.js index 58e425f..2f99b44 100644 --- a/lib/cube/genericGetter.js +++ b/lib/cube/genericGetter.js @@ -27,7 +27,7 @@ function customQuery(collectionObj, filter, sort, limit, batchSize, streamified, cursor = collectionObj.find(filter, cursorOptions); if (streamified) { - stream = cursor.stream(); + stream = cursor.sort({$natural: -1}).stream(); stream.on('data', function (document) { documentHandler({id: document._id instanceof mongodb.ObjectID ? undefined : document._id, time: document.t, data: document.d}); });