如何获得最大的日期价值? [英] How to get maximum value of date?
问题描述
我的Cosmos Mongodb中有以下记录,我想获得最大"LastModifiedDate"的对象。我怎么能这样做?
I have following records in my Cosmos Mongodb and I want to get the object with maximum "LastModifiedDate". How can I do that?
推荐答案
你好Ghilman,
Hello Ghilman,
你可以查询找到以这种方式最大化。
You can query to find the max this way.
db.YourCollectionName.find().sort({LastModifiesTime:-1}).limit(1)
在Azure门户中查询shell时不支持链接
Chaining is not supported while querying from shell within Azure Portal
请使用您最喜欢的MongoDb客户端进行查询。
Please use your favourite MongoDb client to query.
_______________________________________________________________________________
_______________________________________________________________________________
如果上述答案有用,请单击"标记为答案"或"向上投票",这可能对阅读此主题的其他社区成员有益。
If the above answer was helpful, click "Mark as Answer" or "Up-Vote", which might be beneficial to other community members reading this thread.
这篇关于如何获得最大的日期价值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!