Closed RammusXu closed 7 years ago
sudo pip install docker-compose
# Origin : MongoDB + RestHeart
git clone https://github.com/SoftInstigate/restheart-docker.git
# With mongo-express
git clone https://github.com/RammusXu/restheart-docker.git
# 啟動
cd restheart-docker ; docker-compose up -d
# 測試
curl -u admin:changeit localhost:8080
# 新增 db
curl -u admin:changeit PUT 127.0.0.1:8080/testdb
# 新增 collection
curl -u admin:changeit -XPUT 127.0.0.1:8080/testdb/customers -H "Content-Type: application/json" -d '{"name":"rammus"}'
# 查詢 collection
curl -u admin:changeit -XGET 127.0.0.1:8080/testdb/customers -H "Content-Type: application/json"
# 去除collection properties
curl -u admin:changeit -XGET "127.0.0.1:8080/testdb/customers&np" -H "Content-Type: application/json"
{
"_id": "customers",
"name": "Annieeeeeee",
"age": 36,
"_etag": {
"$oid": "57ce4124a7b11b0005529f42"
},
"_returned": 15,
"_embedded": {
"rh:doc": [
Backup mongodb
docker exec -it restheartdocker_mongodb_1 mongodump
docker cp restheartdocker_mongodb_1:/dump mongo-dump
mv mongo-dump/dump mongo-dump/dump-$(date +%Y%m%d_%H%M%S)
來源:https://docs.mongodb.com/ecosystem/tools/http-interfaces/ 選擇:http://restheart.org/
Docker
https://github.com/mongo-express/mongo-express
restheart
https://github.com/SoftInstigate/restheart-docker https://softinstigate.atlassian.net/wiki/display/RH/Enable+and+Configure+Security
Reference