7
我有以下資源定義:Python的前夜 - 查詢嵌入式數據關聯
item = {
'wrapper': {
'type': 'dict',
'schema': {
'element': {
'type': 'objectid',
'data_relation': {
'resource': 'code',
'field': '_id',
'embeddable': True,
},
},
},
},
}
當我嘗試使用OBJECTID查詢,我得到空單。
http://127.0.0.1:5000/item?where={"wrapper.element":"5834987589b0dc353b72c27d"}
5834987589b0dc353b72c27d是元素的有效_id。
如果我移動數據關係進行嵌入文檔中我可以查詢其預期
反正有嵌入數據的關係要做到這一點?
你確定你有'5834987589b0dc353b72c27d'作爲wrapper.element的值插入的項目嗎? – gcw
這是仍然需要的功能。引用此鏈接https://github.com/pyeve/eve-sqlalchemy/issues/100 – bigbounty
@bigbounty,提到的問題是不是大約相同的事情。這個只是基於objectid data_relation值進行過濾,另一個是關於嵌入「sub-sub」文檔,據我所知。 – gcw