Suppose I want to execute 'db.things.insert({colors : ["blue", "black"]})'
in browser. I can execute it in the Mongodb -shell but not yet understanding how to execute it like: open up the Google Chrome Console, initialize the DB -object with some connection and execute the command. Does there exist some plugin? Sorry I am totally new to MongoDB, trying to test just things fast with Browser shell. How can I do the initialization like that?
Trial 0: perhaps with REST -interface?
I have enabled the REST with
"$ echo 'rest=true' > /etc/mongodb.conf; $ sudo restart mongodb"
, works in Ubuntu. More about rest here, not sure yet whether needed here but perhaps with some POST/REST -method I can do the init.Trial 1: Oreilly's book about MongoDB and 50 Tips (page 47)
The book has some example
> db = connect ("ny1a:27017/foo") > db = connect ("ny1a:27017/admin")
so now
> db=connect("localhost:27017/test") ReferenceError: connect is not defined
Yes because I need to source the
connect
-command, some further examples here, where can I get it?
P.s. I am studying this tutorial here.