MongoDB: The Definitive Guide

MongoDB: The Definitive Guide
Kristina Chodorow, Michael Dirolf
17 Sep 2010
Purchase online

How does MongoDB help you manage a huMONGOus amount of data collected through your web application? With this authoritative introduction, you'll learn the many advantages of using document-oriented databases, and discover why MongoDB is a reliable, high-performance system that allows for almost infinite horizontal scalability.

Editorial Reviews

Quietly extract JSON metadata contained within DOM elements.

Basic Usage

1. Include the scripts required:

<script type="text/javascript" src=""></script>
<script type="text/javascript" src=""></script>
<script type="text/javascript" src="metadata-min.js"></script>

2. Store the data in DOM elements

<p id="one" class="someclass {itemid: 1, itemlabel: 'Label 1'}">This is p1</p>
<p id="two" class="someclass" data="{itemid: 2, itemlabel: 'Label 2'}">This is p2</p>
<p id="three" class="someclass"><script type= "text/javascript">{itemid: 3, item_label: 'Label 3'}</script>This is p3</p>

3. Retrieve using metadata

var dom = YAHOO.util.Dom;
var metadata = YAHOO.plugin.Metadata;

metadata.setType("class"); document.write( metadata.get( dom.get("one") ).itemid + ", " + metadata.get( dom.get("one") ).itemlabel + "<br />");

metadata.setType("attr", "data"); document.write( metadata.get( dom.get("two") ).itemid + ", " + metadata.get( dom.get("two") ).itemlabel + "<br />");

metadata.setType("elem", "script"); document.write( metadata.get( dom.get("three") ).itemid + ", " + metadata.get( dom.get("three") ).itemlabel + "<br />");

Using YUI Loader

<script type="text/javascript" src=""></script>
<script type="text/javascript">

var loader = new YAHOO.util.YUILoader({

    onSuccess: function() {

        var dom = YAHOO.util.Dom;
        var metadata = YAHOO.plugin.Metadata;

        // do something with metadata

    name: "metadata",
    type: "js",
    fullpath: "",
    varName: "YAHOO.plugin.Metadata",
    requires: ['yahoo', 'dom']



Documentions and demo

Please view the source code of this link:


Feedback and suggestions are always welcome, you can reach me at tszming at gmail dot com.

You might also like...



Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“There are only two kinds of languages: the ones people complain about and the ones nobody uses” - Bjarne Stroustrup