Created
August 14, 2018 11:25
-
-
Save cn007b/42129d89fa3c1349c54032af38a43c70 to your computer and use it in GitHub Desktop.
PostgreSQL vs MongoDB - mongo query
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.file_storage.aggregate([ | |
{$match: {"count": {$gt: 0}}}, | |
{$unwind: "$files"}, | |
{$project: {_id: 1, sha1: 1, "name": "$files.name"}}, | |
{$sort: {_id: -1, "name": 1}}, | |
{$skip : 1000}, | |
{$limit : 10}, | |
]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment