如何通过时间戳从时间戳从MongoDB获取数据?

时间:2019-03-15 09:40:11

标签: arrays mongodb mongodb-query

  

我无法按时间获取价格{“ asset”:“ EURUSD”,“ price”:“”,“ time”:“”}

<?php
$manager = new MongoDB\Driver\Manager("mongodb://localhost:27017");

$db = $_GET['db'];
$table = $_GET['plateform'];
$asset = $_GET['asset'];
$timestamp = $_GET['timestamp'];

$filter = ['asset' => $asset, 'epoch' => ['$lte' => $timestamp ]];
$options = [
    'sort' => ['_id' => -1],
    'limit'=>1
];

.....
?>

0 个答案:

没有答案