【问题标题】:How to sort from the field of embedd document如何从嵌入文档的字段中排序
【发布时间】:2014-04-29 05:05:08
【问题描述】:

有两个文件

product : {
   name : string,
   price : integer
}

score : {
   product_id : {
        'type': 'objectid',
        'required': True,
        'data_relation' : {
            'resource': 'product ',
            'field': '_id',
            'embeddable': True
        },

   region : string,
   score : integer,
}

我需要得到某个地区的所有分数,按产品价格排序。

当我使用?embedded={"product_id":1}&sort=[("product_id.price", -1)] 作为 GET 请求的参数时。但是好像不行。

【问题讨论】:

  • 你的问题不清楚。您使用什么框架将这些文档公开给 http 请求?
  • eve 标签暗示了他所指的框架,尽管我同意这个问题可能应该更新以使其明确。

标签: python sorting eve


【解决方案1】:

恐怕暂时不支持对嵌入文档字段进行排序。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-06-01
    • 2023-03-24
    相关资源
    最近更新 更多