在问了这个问题后:主题 restHeart得到了满意的答案,我有一个新问题。
我使用了这个 http restHeart 请求:
PATCH http://test:8081/purge/test3 { rts: [
{
"name": "addRequestProperties",
"phase": "REQUEST",
"scope": "CHILDREN",
"args": { "log": [ "dateTime", "epochTimeStamp" ] } }]}
现在当我插入一些 json 数据时,mongo db 会自动添加 datetime 和 epochTimeStamp 这样的:
"invoiceNumber": "6666"
"log": {
"dateTime": "[23/Mar/2016:16:24:24 +0000]"
"epochTimeStamp": 1458750264
}
所以我现在的问题是进行查询。
我尝试了类似的方法但不起作用:
http://test:8081/purge/test3?filter={"log":{"epochTimeStamp":{"$lte":"1458750378"}}}
最后我的查询什么也没得到......
版本 mongo 3.2 / restheart 1.2
希望你能帮我 :)