通过_id字段插入时间在mongodb中对数据进行排序,并允许联系
我希望能够使用_id
字段通过插入时间对数据进行排序,这是唯一的,但是,插入时间不是吗(是吗?)..
是否可以这样做排序?
简而言之,我想做的是:如果多个文档具有相同的插入时间,请按照另一个字段进行排序。
我正在使用Pymongo。
I want to be able to sort data by insertion time using _id
field, the thing is it is unique, but, the insertion time isn't (is it?)..
Is it possible to do such sorting ?
What I want to do in short is: If multiple documents have the same insertion time, sort by another field.
I'm using pymongo.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论