推荐工具
RoboMongo
推荐书目
50 Tips and Tricks for MongoDB Developers
Related Blogs
Snail in a Turtleneck
displayabc
V2EX  ›  MongoDB

mongo 如何查询多个集合?

  •  
  •   displayabc · Jul 29, 2014 · 6707 views
    This topic created in 4387 days ago, the information mentioned may be changed or developed.
    现在是每天的数据在一个集合里,怎么查询这些集合里的特定数据?只查最新的10条数据
    2 replies    2014-08-21 19:07:28 +08:00
    kaulie
        1
    kaulie  
       Aug 21, 2014
    对排序字段加索引,然后直接limit(10)不行行了,不知道楼主的真正意图?@haython
    displayabc
        2
    displayabc  
    OP
       Aug 21, 2014
    @kaulie 用户的访问日志,每天一个集合,现在要查出一个用户的最后10条记录
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2774 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 06:40 · PVG 14:40 · LAX 23:40 · JFK 02:40
    ♥ Do have faith in what you're doing.