Berikut adalah perbandingan Query :
Menggunakan Set Column ( Area Field )
SQLSELECT headline, author FROM article; |
MongoDB Aggregationdb.article.aggregate( |
{ $project : { headline : 1, author : 1 } } |
); |
Compass Project Option{ headline : 1, author : 1 } |
Menggunakan Sort
SQLSELECT * FROM article |
ORDER BY headline ASC; |
MongoDB Aggregationdb.article.aggregate( |
{ $sort : { headline : 1 } } |
); |
Compass Sort Option
Menggunakan Offset / Skip
SQLSELECT * FROM article |
LIMIT 50 OFFSET 435; |
MongoDB Aggregationdb.article.aggregate( |
{ $limit : 50 }, |
{ $skip : 435 } |
); |
Compass Skip Option
Menggunakan Limit
SQLSELECT * FROM article |
LIMIT 10; |
MongoDB Aggregationdb.article.aggregate( |
{ $limit : 10 } |
); |
Compass Limit Option
Reference : https://www.mongodb.com/docs/compass/master/query/filter/