Skip to content

Instantly share code, notes, and snippets.

@pvoznenko
Last active August 29, 2015 14:05
Show Gist options
  • Save pvoznenko/ae9f39b7ac94b2e0c27b to your computer and use it in GitHub Desktop.
Save pvoznenko/ae9f39b7ac94b2e0c27b to your computer and use it in GitHub Desktop.
hw2.2
var cursor = db.data.find({}).sort({State: 1, Temperature:-1});
var state = ''; while (cursor.hasNext()) { var data = cursor.next(); if (state != data.State) { state = data.State; db.data.update(data, {$set: {"month_high": true}}); } }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment