小编hit*_*pac的帖子

MongoDB:查找除日期范围条件匹配的文档之外的所有文档

要求:我想要所有客户的集合did not perform the "View" event in last 5 hours.

数据:

{
    name: "Sheldon",
    events: [
        {
            event: "View",
            timestamp: "timestamp equivalent to 10 hours ago"
        },
        {
            event: "Some other event",
            timestamp: "timestamp equivalent to 8 hours ago"
        },
        {
            event: "View",
            timestamp: "timestamp equivalent to 2 hours ago"
        }
    ]
},
{
    name: "Leonard",
    events: [
        {
            event: "View",
            timestamp: "timestamp equivalent to 10 hours ago"
        }
    ]
},
{
    name: "Howard",
    events: [
        {
            event: …
Run Code Online (Sandbox Code Playgroud)

mongoose mongodb node.js

7
推荐指数
1
解决办法
165
查看次数

标签 统计

mongodb ×1

mongoose ×1

node.js ×1