{"size": 533, "ext": "js", "max_stars_repo_path": "M121 - The MongoDB Aggregation Framework/Files/match_stage.js", "max_stars_repo_name": "ReynerGonzalez/mongodb-university-course", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "M121 - The MongoDB Aggregation Framework/Files/match_stage.js", "max_issues_repo_name": "ReynerGonzalez/mongodb-university-course", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "M121 - The MongoDB Aggregation Framework/Files/match_stage.js", "max_forks_repo_name": "ReynerGonzalez/mongodb-university-course", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 25.380952381, "max_line_length": 66, "alphanum_fraction": 0.6153846154}
// $match all celestial bodies, not equal to Star
db.solarSystem.aggregate([{
  "$match": { "type": { "$ne": "Star" } }
}]).pretty()

// same query using find command
db.solarSystem.find({ "type": { "$ne": "Star" } }).pretty();

// count the number of matching documents
db.solarSystem.count();

// using $count
db.solarSystem.aggregate([{
  "$match": { "type": { "$ne": "Star"} }
}, {
  "$count": "planets"
}]);

// matching on value, and removing ``_id`` from projected document
db.solarSystem.find({"name": "Earth"}, {"_id": 0});
