如何调用此mongo-shell命令:
db.coll.count()
使用restheart?
我试过了:
http GET 127.0.0.1:8080/cloneGame/players/_count
但得到403 Forbidden Error。我的身份验证有问题吗?
谢谢:)
答案 0 :(得分:2)
You get the count of the collection adding the count query parameter to the request URL.
With it RESTHeart adds the _size property to the response.
If you are only interested on getting the count of the collection (without GETting documents) you can do:
http GET 127.0.0.1:8080/cloneGame/players?count\&pagesize=0
More info in the Query Documents文档部分中分隔逗号分隔值。