Suppose I want to execute 'db.things.insert({colors : ["blue", "black"]})'in a browser. I can execute it in the Mongodb shell, but I don’t yet understand how to execute it, for example: open the Google Chrome console, initialize the DB object with some connection and execute the command. Is there any plugin? Sorry, I am completely new to MongoDB, trying to quickly check all things using the browser shell. How can I initialize?
Trial 0: maybe with a REST-interface?
I turned on REST using "$ echo 'rest=true' > /etc/mongodb.conf;
$ sudo restart mongodb"works in Ubuntu. More about the rest here , I’m not sure if it’s necessary here, but maybe with some POST / REST method I can initialize.
Litigation 1: Oreus Book of MongoDB and 50 Tips (p. 47)
The book gives an 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 specify a command connect, some additional examples are here , where can I get it?
Ps I am studying this tutorial here .
source
share