Skip to content

Instantly share code, notes, and snippets.

@s9tpepper
Created July 10, 2011 00:22
Show Gist options
  • Save s9tpepper/1074091 to your computer and use it in GitHub Desktop.
Save s9tpepper/1074091 to your computer and use it in GitHub Desktop.
Using the runCommand() method
/* All the commands can be executing with the Document object. Simple
commands such as "getLastError" are run as below. The Document requires
a colon in all entries using shorthand, thus "getLastError:" */
mongo.db("myDatabase").runCommand(new Document("getLastError:")).addOnce(onLastError);
function onLastError(opReply:OpReply):void
{
// The command response document will be in the first element
// of the documents Array in the OpReply object. The structure
// of the document will depend on the command executed.
var document:Object = opReply.documents[0];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment