【问题标题】:how to query mongo profile greater than a specific date如何查询大于特定日期的mongo配置文件
【发布时间】:2020-07-29 12:45:56
【问题描述】:

如何查询大于特定日期的 Mongodb profiler

db.system.profile.find( { millis : { $gt:20000 } } ).sort( { ts : { $gt:ISODate("2020-07-29T02:10:01.132Z") and $lt:ISODate("2020-07-29T10:10:01.132Z") } } ).pretty()

【问题讨论】:

  • 请发布一些示例数据
  • 数据值必须在find({}),你把它们放在sort

标签: mongodb


【解决方案1】:

阅读本文档 https://docs.mongodb.com/manual/reference/operator/query/gt/

db.system.profile.find({
  millis: {
    $gt: 20000
  },
  ts: {
    $gt: ISODate("2020-07-29T02:10:01.132Z")
  }
}).sort({
  ts: 1
}).pretty()

【讨论】:

    猜你喜欢
    • 2015-04-29
    • 2011-11-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-20
    • 2013-03-06
    • 1970-01-01
    • 2023-02-21
    相关资源
    最近更新 更多