当前位置:网站首页>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
边栏推荐
- Loggie encoding and newline character test
- How to calculate flops and params in deep learning
- dried food! Yiwen will show you SD card, TF card and SIM card!
- Investment planning and forecast report on the future direction of China's smart agriculture during the 14th five year plan (2022)
- Re recognized! Know that Chuangyu has been selected as one of the first member units of the "business security promotion plan"
- Omni channel member link - tmall member link 3: preparation of member operation content
- [graduation season · advanced technology Er] I remember the year after graduation
- Matlab programming example: how to count the number of elements in a cell array
- VMware虚拟机 桥接模式 无法上网 校园网「建议收藏」
- 我想知道,股票开户有哪些优惠活动?网上开户是否安全么?
猜你喜欢
![[redis series] redis learning 16. Redis Dictionary (map) and its core coding structure](/img/d2/a6cbb0abe9e04c412d1f6021430528.png)
[redis series] redis learning 16. Redis Dictionary (map) and its core coding structure

Build Pikachu shooting range and introduction
女性科学家的流失

Xiaolong 888 was released, Xiaomi 11 was launched, and 14 manufacturers carried it in the first batch!

Vscode solves the problem of Chinese garbled code

Scala-day03- operators and loop control

Scala problem solving the problem of slow SBT Download

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

Quantitative elementary -- akshare obtains stock code, the simplest strategy

Deep thinking from senior member managers
随机推荐
International beauty industry giants bet on China
Scala-day01- companion objects and HelloWorld
Redis cannot connect to the server through port 6379
fastjson的JSONArray和JSONObject[通俗易懂]
I want to know how the top ten securities firms open accounts? Is online account opening safe?
This executeQuery (SQL) cannot compile classes for JSP. What is the reason?
Five trends of member marketing of consumer goods enterprises in the future
leetcode 715. Range 模块 (hard)
2022 edition of China's energy and chemical industry market in-depth investigation and investment feasibility analysis report
MS17_ 010 utilization summary
The best CMDB system
4. N queen problem
On the use of protostaff [easy to understand]
HUST網絡攻防實踐|6_物聯網設備固件安全實驗|實驗二 基於 MPU 的物聯網設備攻擊緩解技術
Is it safe to open an account in the top ten securities app rankings in China
Spark-day01- get started quickly
Php+laravel5.7 use Alibaba oss+ Alibaba media to process and upload image / video files
Pratique de l'attaque et de la défense du réseau HUST | 6 Expérience de sécurité du microprogramme de l'équipement IOT | expérience 2 technologie d'atténuation des attaques de l'équipement IOT basée s
VMware virtual machine bridging mode can not access the campus network "suggestions collection"
大智慧哪个开户更安全,更好点