Is it possible to write to mongodb console in javascript execution?

You have to use ‘print( "anything .." )‘ or printjson to display objects.

andrey@andrey:~$ mongo
MongoDB shell version: 2.0.2
connecting to: test
> object = { "name" : "any name .." , "key" : "value" }
{ "name" : "any name ..", "key" : "value" }
> printjson ( object )
{ "name" : "any name ..", "key" : "value" }
> print ( "hello world" )
hello world
>

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)