问题
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