Parse.com Query on Child Object Key within an Array of Objects Column

陌路散爱 提交于 2019-12-14 03:18:09

问题


A Parse class has a column labeled BoxData and is an Array type. Each value for that BoxData column is an array of objects.

BoxData (Array)
BoxData value1 = [{"boxID":"1","boxWeight":"12kg"},{"boxID":"4","boxWeight":"12kg"}]
BoxData value2 = [{"boxID":"12","boxWeight":"12kg"},{"boxID":"24","boxWeight":"12kg"}]
BoxData value3 = [{"boxID":"123","boxWeight":"12kg"},{"boxID":"124","boxWeight":"12kg"}]

equalTo("BoxData.boxID","124") does not work.

How should a Parse Javascript SDK query be written with constraints if trying to return all rows where boxID=124 ?


回答1:


You can't use dot notation with Array or Dictionary types. This feature can only be used with Pointer types.

https://parse.com/questions/includekey-dot-notation-doesnt-work-on-arrays



来源:https://stackoverflow.com/questions/33510945/parse-com-query-on-child-object-key-within-an-array-of-objects-column

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!