当前位置:网站首页>TP5 thinkphp5 extension package think Mongo operation mongodb time interval range query
TP5 thinkphp5 extension package think Mongo operation mongodb time interval range query
2022-06-26 12:23:00 【Yotoai Mengtian】
It uses tp5.0.20 edition ,php7.2 edition , Code up :
// tp5 Db Query methods
$list = Db::connect($this->connection)
->name($table_name)
->where('date', 'between time', ['2018-09-10','2018-09-26'])
->field($field)
->order($type, 'desc')
->select();
// modify topthink/think-mongo/Builder.php , 273 OK, let's start
} elseif ('between time' == $exp) {
// Interval query
$value = is_array($value) ? $value : explode(',', $value);
$query[$key] = ['$gte' => new \MongoDB\BSON\UTCDateTime($this->parseDateTime($value[0], $field) * 1000), '$lte' => new \MongoDB\BSON\UTCDateTime($this->parseDateTime($value[1], $field) * 1000)];
}So we can find out the data .
Reprint please indicate the source ! thank you
边栏推荐
- Omni channel member link - tmall member link 3: preparation of member operation content
- Scala-day02- variables and data types
- 女性科学家的流失
- 2022 edition of investment analysis and "fourteenth five year plan" development prospect forecast report of China's switchgear industry
- redis通过6379端口无法连接服务器
- Using the methods in the repository to solve practical problems
- 证券账户可以开通 开户安全吗
- 这两天搭建环境遇到的几个问题
- Loggie encoding and newline character test
- leetcode 715. Range 模块 (hard)
猜你喜欢

HUST网络攻防实践|6_物联网设备固件安全实验|实验三 FreeRTOS-MPU 保护绕过

Mqtt disconnect and reconnect

Using the methods in the repository to solve practical problems

利用 Repository 中的方法解决实际问题

Introduction to the four major FPGA manufacturers abroad

2021 q3-q4 investigation report on the use status of kotlin multiplatform

International beauty industry giants bet on China

PHP uses laravel pay component to quickly access wechat jsapi payment (wechat official account payment)

How to calculate flops and params in deep learning

国际美妆业巨头押注中国
随机推荐
Statistical genetics: Chapter 2, the concept of statistical analysis
Re recognized! Know that Chuangyu has been selected as one of the first member units of the "business security promotion plan"
[graduation season · advanced technology Er] I remember the year after graduation
One click deployment of your own community forum
24 database interview questions that must be mastered!
Xiaolong 888 was released, Xiaomi 11 was launched, and 14 manufacturers carried it in the first batch!
HUST network attack and defense practice | 6_ IOT device firmware security experiment | Experiment 3 freertos-mpu protection bypass
Mysql8 master-slave replication
MS17_ 010 utilization summary
China's smart toy market outlook and investment strategy consulting forecast report from 2022 to 2027
How do consumer goods enterprises formulate membership interests?
I'd like to know what preferential activities are available for stock account opening? Is it safe to open an account online?
Current situation investigation and investment prospect forecast analysis report of China's electrolytic copper market from 2022 to 2028
4. N queen problem
[redis series] redis learning 16. Redis Dictionary (map) and its core coding structure
leetcode 715. Range module (hard)
Polarismesh series articles - concept series (I)
ctfshow web入门 命令执行web75-77
Analysis report on China's photovoltaic inverter market prospect forecast and investment strategy recommendations in 2022
One click deployment CEPH script