Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/mongodb/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 使用eve REST API在GET查询中按值排序dict_Python_Mongodb_Rest_Eve - Fatal编程技术网

Python 使用eve REST API在GET查询中按值排序dict

Python 使用eve REST API在GET查询中按值排序dict,python,mongodb,rest,eve,Python,Mongodb,Rest,Eve,我的域配置中有以下架构: DOMAIN = { 'adv': { 'schema': { '_id': {'type': 'string'}, 'matchups': { 'type': 'dict', 'schema': { 'name': {'type': 'string'}, 'value': {'type': 'double'} }, }, },

我的域配置中有以下架构:

DOMAIN = {
  'adv': {
    'schema': {
      '_id': {'type': 'string'},
      'matchups': {
        'type': 'dict',
        'schema': {
          'name': {'type': 'string'},
          'value': {'type': 'double'}
        },
      },
    },
  },
}
尽管按
\u id
排序有效:

http://127.0.0.1:5000/adv/?sort=[("_id",1)]
按dict值或名称排序不起作用:

http://127.0.0.1:5000/adv/?sort=[("matchups.value",1)]

常规终结点不支持按子文档字段排序。然而,您可以使用一个类似的方法来实现类似的结果