mongodb - 如果日期在 mongodb 中为 ISODate 格式,如何使用 $gte 和 <e mongo 运算符
问题描述
db.claimPaymentLog.find({"claimDate":{"$lte":{"sec":1579046400,"usec":0}}})
我{"claimDate":{"$lte":{"sec":1579046400,"usec":0}}
在数据库中有 claimDate 字段。现在我想在字符串格式的 claimDate 字段上执行$gte
和操作,如下所示:<e
我的代码:
$start = new MongoDate(strtotime("2020-01-15 00:00:00"));
$this->_collection->find({"claimDate":{"$lte":$start}});
解决方案
推荐阅读
- python - PyCharm 见对象数据类型
- go - 如何修复 os.PathSeparator 解压缩在 Windows 上压缩的文件?
- c++ - 如何修复:编译器不会接收到 CMake 定义的宏
- javascript - 将 JS 集成到 Angular 中的正确方法
- java - java gui终端应用程序发送有限的数据
- java - 如何在 Spring-boot 中为 REST API 的每个请求创建唯一 ID?
- java - 如何在 JPanel 中启用溢出滚动条?
- javascript - 在javascript中对数组进行排序和操作
- java - 如何订购对象矩阵
- sql - 从字符串中删除特定字符 (SQL Server 2012)