MongoDB comes with the HTTP REST API

Source: Internet
Author: User
Tags mongodb server port

MongoDB defaults to open an HTTP protocol port to provide rest service, this port is your server port plus 1000,

For example, your server port is 27017, then this HTTP port is 28017, the default HTTP port is the Database status page,

You can use--rest Mongod startup parameters to work with more features.


MongoDB comes with rest, does not support Add, delete, change , and also does not support authorization authentication , 10gen also said that MongoDB mention

The certification is simple enough to allow the above support to be considered with Sleepy.mongoose.


Supported operations:

Lists all the data under the CollectionName collection in the DatabaseName database:
http://127.0.0.1:28017/databaseName/collectionName/add a limit parameter to the above data set limits return 10
Http://127.0.0.1:28017/databaseName/collectionName/?limit=-10 to the above data plus a skip parameter setting skip 5 records
Http://127.0.0.1:28017/databaseName/collectionName/?skip=5 Plus limit limit and skip limit
http://127.0.0.1:28017/databaseName/collectionName/?skip=5&limit=10 result filtering by condition {a:1} (followed by your field name in the keyword filter)
Http://127.0.0.1:28017/databaseName/collectionName/?filter_a=1 plus limit number of return bars
Http://127.0.0.1:28017/databaseName/collectionName/?filter_a=1&limit=-10 Execute arbitrary command
If you want to execute a specific command, you can execute the Find command on the admin. $cmd, as well as in the rest API, and execute the {listdatabase:1} command as follows:
http://localhost:28017/admin/number of records $cmd/?filter_listdatabases=1&limit=1 query collection: http://host:port/db/$cmd/? Filter_count=collection&limit=1



Reference: http://docs.mongodb.org/manual/administration/security/
           /HTTP/ Www.mongodb.org/display/DOCS/Http+Interface#HttpInterface-HTTPInterfaces


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.