在问了这个问题之后:topic 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
希望你能帮助我:)
发布于 2016-03-24 15:42:37
您正在将一个字符串传递给$lte操作符。
您需要传递一个数字:
http://test:8081/purge/test3?filter={"log.epochTimeStamp":{"$lte": 1458750378}}https://stackoverflow.com/questions/36184562
复制相似问题