【发布时间】:2020-12-02 01:14:13
【问题描述】:
我怎样才能从传入的后有效负载中获得一种动态数据源? 因此,所有传入的有效负载在 mongodb 中“创建”一个新集合,或者使用旧的集合(如果可用)...
例如。有效载荷: {“a1”:“999”,“d1”:“06.05.2020 04:29:16”,“d2”:“0”,“d3”:“0”,“id2” :“3777”}
settings.py 的一部分:
mdata = {
'schema': {
**'a1': {
'type': 'string'**
},
'd1': {
'type': 'string'
},
'd2': {
'type': 'string'
},
'd3': {
'type': 'string'
},
'id2': {
'type': 'string'
}
},
'datasource': {
**'source': "a1-value" #should be 'a1' value from the post payload**
},
"resource_methods": ["POST"],
}
DOMAIN = {
"accounts": accounts,
"user": user,
"mdata": madata,
}
【问题讨论】:
标签: eve