Enabling the MongoDB cartridge REST interface
MongoDB exposes a minimal REST interface that allows users to query collections. The interface does not expose operations to insert, update, or remove documents. In this recipe, you will learn how to enable the MongoDB cartridge REST interface.
Getting ready
To complete this recipe, you will need an application with a MongoDB cartridge. Refer to the Adding a MongoDB cartridge to your application recipe in this chapter to learn how to add one.
How to do it…
Perform the following steps to enable the MongoDB REST interface:
Open a new command-line terminal and SSH into the
myapp
application gear using thessh
command:$ rhc ssh --app myapp
Once inside the application gear, change the directory to
mongodb/conf
and edit themongodb.conf
file using Vim.Now, we need to update the
nohttpinterface
property value tofalse
so that MongoDB enables the HTTP frontend on the28017
port. To enable the REST interface, you have to add a new property,rest
, and set...