Index: library/mongodb/nx-mongo.tcl =================================================================== diff -u -r9cdb38c7c44b7c94af338e90c089aa2e0cd77201 -r6cff9d9b2c329e124fafd745004950b2822eb548 --- library/mongodb/nx-mongo.tcl (.../nx-mongo.tcl) (revision 9cdb38c7c44b7c94af338e90c089aa2e0cd77201) +++ library/mongodb/nx-mongo.tcl (.../nx-mongo.tcl) (revision 6cff9d9b2c329e124fafd745004950b2822eb548) @@ -224,7 +224,8 @@ # # The methods "bson encode|decode" perform the low level type - # mapping. For now, this handles just the array notation. + # mapping between NX objects and the bson serialization. For now, + # this handles just the array notation. # :public method "bson decode" {bsontype value} { #puts stderr "bson decode of ${:name} /$bsontype/ '$value'" @@ -920,6 +921,14 @@ return $bson } + :public method "bson asJSON" {} { + # + # Return the current object in JSON syntax. + # + return [mongo::json::generate [:bson encode]] + } + + # # destroy a mapped object from memory #