Skip to content

Instantly share code, notes, and snippets.

View vivekfe's full-sized avatar

Vivek Srivastava vivekfe

View GitHub Profile
@vivekfe
vivekfe / 0_reuse_code.js
Created January 31, 2014 15:25
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
// Start the MongoDB Container
docker run --name mongo -d mongo
docker exec -i mongo sh -c 'mongoimport -d oreilly -c students --drop --type json' < students.json
// Check that Mongodb adds a projection on non-used fields
db.students.explain("executionStats").aggregate( [
{ $group: { _id: "$grade", frequency: { $sum: 1 } } },
{ $match: { "frequency": { $gt : 10 } } }