标签: mongodb
是否可以获取查询文档的位置? 例如:
db.users.find().sort({created:-1})
返回:
0: {name:"user1",created:5} 1: {name:"user1",created:4} 2: {name:"user1",created:3} 3: {name:"user1",created:2}
如何获取这些索引(0,1,2,3)?