API Docs for:
Show:

MongoDocument Class

Module: ringo-mongodb

MongoDocument

Constructor

MongoDocument

(
  • collection
  • doc
)

Parameters:

  • collection MongoCollection

    The collection to work with

  • doc Object

    DBObject document

Item Index

Methods

Properties

Methods

toJSON

() String

Serialize this document to JSON

Returns:

String: JSON representation of the document

Properties

data

Object

Document object map

Example:

 var col = mongo.connect().getDB('myDatabase').getCollection('myCollection');
 var doc = col.findOne( { firstname: "John" } } );
 doc.data.firstname === "John" // true