MongoAS3 is a driver for MongoDb that works without the use of a server side language. The driver is written in pure AS3 so it is usable in both pure AS3/Flash projects as well as Flex projects.


/* Use a Document object to build the BSON document to save into the database */
const newDocument:Document = new Document();
newDocument.put("name", "Hello from Flash sucka!");

/* Use the insert() method to save. This method does not return anything */

/* Use a getLastError command to get the status of the last insert attempt. */
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];

    // The ok property should equal 1 if the insert was a success.
    if (1 == document.ok)
Misc . URL.