Files
ETAApi/scripts/playground.mongodb.js

29 lines
537 B
JavaScript

/* global use, db */
// MongoDB Playground
// Use Ctrl+Space inside a snippet or a string literal to trigger completions.
// The current database to use.
use('enrutaviaporte');
// Search for documents in the current collection.
db.getCollection('loads')
.find(
{
_id : ObjectId('66c151a1299e3cfe8fa4a1dc')
},
{
/*
* Projection
* _id: 0, // exclude _id
* fieldA: 1 // include field
*/
}
)
.sort({
/*
* fieldA: 1 // ascending
* fieldB: -1 // descending
*/
});