Last active
May 17, 2016 11:46
-
-
Save makeittotop/b6d6bdbad67960910483 to your computer and use it in GitHub Desktop.
A mongodb function to wade through a collection and report the `status` of a particular `stream`.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function find_info(stream, status) { | |
var query = {}; | |
var key = stream + "_status"; | |
query[key] = status; | |
db.tasks.find(query).forEach( | |
function(doc) { | |
print("Task " + status + ": " + doc[stream+"_id"] +", owner: " + doc.task_owner); | |
} | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment