restheard--Connection MongoDB Interface Summary

Source: Internet
Author: User
Tags mongodb interface

Name Method Url Pass parameter (JSON) Explain
Create a library Put Http://127.0.0.1:8033/test Create a library
Create a table Put Http://127.0.0.1:8033/test/coll Create a table
Inserting data Post Http://127.0.0.1:8033/test/coll [
{
"Name": "Harry",
"Age": "30",
"Sex": "Female"
},
{
"Name": "Zhao Liu",
"Age": "35",
"Sex": "Male"
}, {
"Name": "Ma qi",
"Age": "40",
"Sex": "Male"
}, {
"Name": "Ding",
"Age": "50",
"Sex": "Female"
}, {
"Name": "Ding er",
"Age": "30",
"Sex": "Female"
}, {
"Name": "Ding Three",
"Age": "20",
"Sex": "Female"
}, {
"Name": "Cyclobutanetetrone",
"Age": "18",
"Sex": "Male"
}
]
Inserting data
Find Get Http://127.0.0.1:8033/test/coll Find All
Conditional lookup (gender) Get http://127.0.0.1:8033/test/coll?filter={' sex ': ' Woman '} Find out all the girls
Sort (by age) Get Http://127.0.0.1:8033/test/coll?sort_by=age Sort by age Search
Find Get Http://127.0.0.1:8033/test/coll?sort_by=age&sort_by=sex Based on the age and sex sequence, how is the reverse order/test/coll?sort_by=-age (the other same)
Find Get http://127.0.0.1:8033/test/coll?keys={' name ': 1} Return only the Name field
Find Get http://127.0.0.1:8033/test/coll?keys={' name ': 0} Returns the other fields except name
Fuzzy Lookup Get http://127.0.0.1:8033/test/coll?filter={' age ': {' $regex ': ' (^ (3[1-9) | ( [2-9]\d) | ([1-9]\d{2,})) $) '}} ' Use regular expressions to find out if the age is greater than 30 or less than 40 (you can also use Chinese such as filter={' name ': {' $regex ': ' d '}} ") can also double query
Page out Get http://127.0.0.1:8033/test/coll?count&page=3&pagesize=2 Find the total number of bars, and 20th to 29 of the data, each page shows two
Fuzzy Lookup + pagination Get http://127.0.0.1:8033/test/coll?count&page=1&pagesize=4&filter={' name ': {' $regex ': ' d '}} ' Pagination lookup + Conditional Fuzzy Lookup
Reference Address: Https://softinstigate.atlassian.net/wiki/display/RH01X/Query+Documents
https://softinstigate.atlassian.net/wiki/pages/viewpage.action?pageId=23461902

restheard--Connection MongoDB Interface Summary

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.