mongodb代码

根据时间倒序,查看10条
db.表名.find({"_id":"xxx"}).sort({"inserted":-1}).limit(10).skip(1)

  

相对的php代码

  $postArr = $this->mongo->executeQuery(
            表名,
            [
                '_id' => new ObjectId(字符串id)
            ],
            [
                'sort' => [
                    'inserted' => -1
                ],
                'limit' => 10,
                'skip' => 1,
                'projection' => array(
                    '_id' => 1
                )
            ]
        );


  

相关文章:

  • 2022-12-23
  • 2022-01-30
  • 2022-12-23
  • 2021-11-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-05
猜你喜欢
  • 2021-05-21
  • 2021-10-05
  • 2021-04-11
  • 2021-09-01
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案