如何获取一段时间的数据?

时间:2018-06-26 09:56:54

标签: node.js mongodb mongoskin

数据库为mongodb,时间字段类型为字符串,例如“ 2018-6-24”

我想获取一段时间的数据,代码是

fetch('http://localhost:8092/api/shops/search?searchString=spicy')
    .then(function(response) {
        if (response.status >= 400) {
            throw new Error("Bad response from server");
        }
        return response.json();
    })
    .then(function(stories) {
        console.log('hej', stories);
    });

但是我出了点问题,该怎么办?

0 个答案:

没有答案